hexsha stringlengths 40 40 | size int64 7 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 125 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 368k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 247 | max_issues_repo_name stringlengths 4 125 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 247 | max_forks_repo_name stringlengths 4 125 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 1 1.04M | avg_line_length float64 1.77 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 7 1.04M | filtered:remove_function_no_docstring int64 -102 942k | filtered:remove_class_no_docstring int64 -354 977k | filtered:remove_delete_markers int64 0 60.1k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f77ea59bf822539953a84da90bca3bded5b1d71d | 4,051 | py | Python | spider/wenkubaidu/wenku.py | JackyYuanjie/python-scripts | 490eb9668bda6db004ae87d204588fb6ffe56051 | [
"Apache-2.0"
] | 1 | 2021-07-08T05:09:38.000Z | 2021-07-08T05:09:38.000Z | spider/wenkubaidu/wenku.py | JackyYuanjie/python-scripts | 490eb9668bda6db004ae87d204588fb6ffe56051 | [
"Apache-2.0"
] | null | null | null | spider/wenkubaidu/wenku.py | JackyYuanjie/python-scripts | 490eb9668bda6db004ae87d204588fb6ffe56051 | [
"Apache-2.0"
] | 1 | 2020-01-09T07:29:17.000Z | 2020-01-09T07:29:17.000Z | #!/usr/bin/env python
# -*- coding:utf-8 -*-
import urllib
import requests
from bs4 import BeautifulSoup
"""
https://wenku.baidu.com/browse/getrequest?doc_id=a1eec6289b6648d7c1c7468f&pn=22&rn=1&type=ppt&callback=bd__cbs__s5lw72
https://wenku.baidu.com/browse/getrequest?doc_id=a1eec6289b6648d7c1c7468f&pn=23&rn=1&type... | 44.032609 | 883 | 0.689459 | #!/usr/bin/env python
# -*- coding:utf-8 -*-
import urllib
import requests
from bs4 import BeautifulSoup
"""
https://wenku.baidu.com/browse/getrequest?doc_id=a1eec6289b6648d7c1c7468f&pn=22&rn=1&type=ppt&callback=bd__cbs__s5lw72
https://wenku.baidu.com/browse/getrequest?doc_id=a1eec6289b6648d7c1c7468f&pn=23&rn=1&type... | 2,563 | 0 | 80 |
dc824dbc29f0b42ffaa3b7d3fe8147c1f7a32031 | 18,983 | py | Python | source/xgm_mod_options.py | Omni-9/warband_mod_source | c9737d7793ccdb185d8d3caedda0da915104e405 | [
"BSD-Source-Code"
] | 14 | 2018-09-20T23:01:27.000Z | 2021-05-25T11:05:09.000Z | source/xgm_mod_options.py | Omni-9/warband_mod_source | c9737d7793ccdb185d8d3caedda0da915104e405 | [
"BSD-Source-Code"
] | 44 | 2018-09-15T03:05:50.000Z | 2022-03-22T02:46:24.000Z | source/xgm_mod_options.py | Omni-9/warband_mod_source | c9737d7793ccdb185d8d3caedda0da915104e405 | [
"BSD-Source-Code"
] | 13 | 2018-10-02T11:45:24.000Z | 2021-08-22T18:41:44.000Z | from header_common import *
from header_presentations import *
from header_mission_templates import *
from ID_meshes import *
from header_operations import *
from header_triggers import *
from module_constants import *
#import string
from xgm_mod_options_header import *
###############################################... | 30.716828 | 155 | 0.566928 | from header_common import *
from header_presentations import *
from header_mission_templates import *
from ID_meshes import *
from header_operations import *
from header_triggers import *
from module_constants import *
#import string
from xgm_mod_options_header import *
###############################################... | 1,469 | 15 | 368 |
8abd70df157d14db679e659f636c0cd688861cb3 | 6,182 | py | Python | examples/pde/utilities3.py | mkhodak/relax | f6b5a318d74fc1209ba67ec95d2118698194f9c5 | [
"MIT"
] | 11 | 2021-10-01T17:23:18.000Z | 2022-03-31T22:10:36.000Z | examples/pde/utilities3.py | mkhodak/relax | f6b5a318d74fc1209ba67ec95d2118698194f9c5 | [
"MIT"
] | null | null | null | examples/pde/utilities3.py | mkhodak/relax | f6b5a318d74fc1209ba67ec95d2118698194f9c5 | [
"MIT"
] | null | null | null | import torch
import numpy as np
import scipy.io
import h5py
import torch.nn as nn
#################################################
#
# Utilities
#
#################################################
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
# reading data
# normalization, pointwise gaussi... | 26.761905 | 113 | 0.550793 | import torch
import numpy as np
import scipy.io
import h5py
import torch.nn as nn
#################################################
#
# Utilities
#
#################################################
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
# reading data
class MatReader(object):
def _... | 4,841 | 51 | 828 |
15b531407df3e093f666b046edd03aed1f14e76a | 4,874 | py | Python | book_search/models.py | drogers141/book-search | 0745eb3b25023a44da4c6e7fc4d96de086549f04 | [
"MIT"
] | null | null | null | book_search/models.py | drogers141/book-search | 0745eb3b25023a44da4c6e7fc4d96de086549f04 | [
"MIT"
] | null | null | null | book_search/models.py | drogers141/book-search | 0745eb3b25023a44da4c6e7fc4d96de086549f04 | [
"MIT"
] | null | null | null | from io import StringIO
import re
from pathlib import Path
import logging
from django.db import models
from django.conf import settings
from bs4 import BeautifulSoup
from tika import parser
logger = logging.getLogger(__name__)
class TikaParseError(RuntimeError):
"""Raised when the conversion of a document into ... | 38.078125 | 115 | 0.649569 | from io import StringIO
import re
from pathlib import Path
import logging
from django.db import models
from django.conf import settings
from bs4 import BeautifulSoup
from tika import parser
logger = logging.getLogger(__name__)
class TikaParseError(RuntimeError):
"""Raised when the conversion of a document into ... | 182 | 0 | 81 |
7b9c55eaa5d05bc09b14fe1a2ce8e97213b9c0ef | 2,284 | py | Python | bminf/core/context.py | AdamBear/BMInf | 8e650dc30e3ed9d7d628153b0a4dbd76d97ea948 | [
"Apache-2.0"
] | 206 | 2021-09-23T08:55:29.000Z | 2022-03-26T13:15:41.000Z | bminf/core/context.py | AdamBear/BMInf | 8e650dc30e3ed9d7d628153b0a4dbd76d97ea948 | [
"Apache-2.0"
] | 24 | 2021-09-24T05:54:39.000Z | 2022-03-25T01:44:49.000Z | bminf/core/context.py | AdamBear/BMInf | 8e650dc30e3ed9d7d628153b0a4dbd76d97ea948 | [
"Apache-2.0"
] | 34 | 2021-09-26T02:17:29.000Z | 2022-03-28T07:01:54.000Z | from typing import List, Tuple, Type
from .tensor import Tensor
from .device import Device
from .allocator import Allocator
from cpm_kernels.library import cudart
import numpy as np
import logging
logger = logging.getLogger(__name__) | 30.453333 | 91 | 0.612522 | from typing import List, Tuple, Type
from .tensor import Tensor
from .device import Device
from .allocator import Allocator
from cpm_kernels.library import cudart
import numpy as np
import logging
logger = logging.getLogger(__name__)
class Context:
def __init__(self,
device_idx : List[int],
... | 1,785 | 243 | 23 |
d79f6521598d0b35ad0abac23c970dfac3a65db6 | 3,999 | py | Python | code/python_scripts/dlinked_list.py | lukaschoebel/LUMOS | 5d084e487d937957896a58ef3ab719f86074fa9a | [
"MIT"
] | null | null | null | code/python_scripts/dlinked_list.py | lukaschoebel/LUMOS | 5d084e487d937957896a58ef3ab719f86074fa9a | [
"MIT"
] | null | null | null | code/python_scripts/dlinked_list.py | lukaschoebel/LUMOS | 5d084e487d937957896a58ef3ab719f86074fa9a | [
"MIT"
] | null | null | null |
if __name__ == "__main__":
dlinkedList = DoublyLinkedList(10)
dlinkedList.append(20)
dlinkedList.append(30)
dlinkedList.prepend(-5)
dlinkedList.prepend(-8)
dlinkedList.insert(value=12, index=2)
dlinkedList.print_list()
dlinkedList.remove(index=5)
dlinkedList.insert(val... | 26.483444 | 85 | 0.523631 | class Node:
def __init__(self, value):
self.value = value
self.prev = None
self.next = None
class DoublyLinkedList:
def __init__(self, value):
self.head = Node(value)
self.tail = self.head
self.length = 1
def append(self, value):
''' Adds a value to... | 345 | 3,131 | 71 |
7893b475e4bb1bb6f28c83e8b1af171635285c0f | 843 | py | Python | setup.py | BOLD-lab/abbreviator | aca379362f04033c7cd1c62ca50b68280f3799c7 | [
"MIT"
] | null | null | null | setup.py | BOLD-lab/abbreviator | aca379362f04033c7cd1c62ca50b68280f3799c7 | [
"MIT"
] | null | null | null | setup.py | BOLD-lab/abbreviator | aca379362f04033c7cd1c62ca50b68280f3799c7 | [
"MIT"
] | null | null | null | import setuptools
import os
with open("README.md", "r") as fh:
long_description = fh.read()
if os.environ.get('CI_COMMIT_TAG'):
version = os.environ['CI_COMMIT_TAG']
else:
version = "0.0.4"
setuptools.setup(
name="abbreviator",
version=version,
author="Stephanie Wagenaar",
author_email="s... | 28.1 | 71 | 0.679715 | import setuptools
import os
with open("README.md", "r") as fh:
long_description = fh.read()
if os.environ.get('CI_COMMIT_TAG'):
version = os.environ['CI_COMMIT_TAG']
else:
version = "0.0.4"
setuptools.setup(
name="abbreviator",
version=version,
author="Stephanie Wagenaar",
author_email="s... | 0 | 0 | 0 |
9c86682e5fb8a773190f40daabb31d80b79ab5ec | 750 | py | Python | week3/array_partition1.py | ravichalla/wallbreaker | 0d587f12c60df5e4bca47f9183484a69d284d1f5 | [
"MIT"
] | null | null | null | week3/array_partition1.py | ravichalla/wallbreaker | 0d587f12c60df5e4bca47f9183484a69d284d1f5 | [
"MIT"
] | null | null | null | week3/array_partition1.py | ravichalla/wallbreaker | 0d587f12c60df5e4bca47f9183484a69d284d1f5 | [
"MIT"
] | null | null | null | '''
QUESTION:
561. Array Partition I
Given an array of 2n integers, your task is to group these integers into n pairs of integer, say (a1, b1), (a2, b2), ..., (an, bn) which makes sum of min(ai, bi) for all i from 1 to n as large as possible.
Example 1:
Input: [1,4,3,2]
Output: 4
Explanation: n is 2, and the maximum... | 25.862069 | 205 | 0.64 | '''
QUESTION:
561. Array Partition I
Given an array of 2n integers, your task is to group these integers into n pairs of integer, say (a1, b1), (a2, b2), ..., (an, bn) which makes sum of min(ai, bi) for all i from 1 to n as large as possible.
Example 1:
Input: [1,4,3,2]
Output: 4
Explanation: n is 2, and the maximum... | 141 | 2 | 49 |
ab350b87bb10980d6dc5033bd97c6e224e09e86b | 30 | py | Python | account_payment_fix/models/__init__.py | odoo-mastercore/odoo-argentina | 58cdfe8610bae42f69ddb9d652a28eb3245f6a04 | [
"MIT"
] | 1 | 2021-01-25T15:57:58.000Z | 2021-01-25T15:57:58.000Z | account_payment_fix/models/__init__.py | odoo-mastercore/odoo-argentina | 58cdfe8610bae42f69ddb9d652a28eb3245f6a04 | [
"MIT"
] | null | null | null | account_payment_fix/models/__init__.py | odoo-mastercore/odoo-argentina | 58cdfe8610bae42f69ddb9d652a28eb3245f6a04 | [
"MIT"
] | 2 | 2020-10-17T16:36:02.000Z | 2021-01-24T10:20:05.000Z | from . import account_payment
| 15 | 29 | 0.833333 | from . import account_payment
| 0 | 0 | 0 |
96c66bbd32ce6b5cd183eb7717b9022db143812a | 4,881 | py | Python | cisco_dnac_mac_lookup_runner.py | sarar0sa/Cisco_Mac_Lookup | b657b9ed0ecc60df008e02b6e008b09914cf07bf | [
"Apache-2.0"
] | null | null | null | cisco_dnac_mac_lookup_runner.py | sarar0sa/Cisco_Mac_Lookup | b657b9ed0ecc60df008e02b6e008b09914cf07bf | [
"Apache-2.0"
] | null | null | null | cisco_dnac_mac_lookup_runner.py | sarar0sa/Cisco_Mac_Lookup | b657b9ed0ecc60df008e02b6e008b09914cf07bf | [
"Apache-2.0"
] | null | null | null | from time import sleep
import csv
from datetime import datetime
import mac_vendor_lookup
import cisco_service
if __name__ == "__main__":
# Cool banner ofc
print("""
╔═╗╦╔═╗╔═╗╔═╗ ╔╦╗╔╗╔╔═╗╔═╗ ╔╦╗╔═╗╔═╗ ╦ ╔═╗╔═╗╦╔═╦ ╦╔═╗
║ ║╚═╗║ ║ ║ ║║║║║╠═╣║ ║║║╠═╣║ ... | 59.52439 | 110 | 0.562795 | from time import sleep
import csv
from datetime import datetime
import mac_vendor_lookup
import cisco_service
class CiscoDnacMacLookupRunner():
headers = {'Content-Type': 'application/json'}
def __init__(self):
self.cisco = cisco_service.CiscoService()
self.mac_lookup = mac_vendor_lookup.MacL... | 1,719 | 118 | 23 |
5c91270d3182c380f67eb1e558dd0deceb956262 | 1,354 | py | Python | dependencies/scons-config/build/lib.linux-x86_64-2.7/sconsconfig/tools/llvm.py | maierbn/opendihu | 577650e2f6b36a7306766b0f4176f8124458cbf0 | [
"MIT"
] | 17 | 2018-11-25T19:29:34.000Z | 2021-09-20T04:46:22.000Z | dependencies/scons-config/build/lib.linux-x86_64-2.7/sconsconfig/tools/llvm.py | maierbn/opendihu | 577650e2f6b36a7306766b0f4176f8124458cbf0 | [
"MIT"
] | 1 | 2020-11-12T15:15:58.000Z | 2020-12-29T15:29:24.000Z | dependencies/scons-config/build/lib.linux-x86_64-2.7/sconsconfig/tools/llvm.py | maierbn/opendihu | 577650e2f6b36a7306766b0f4176f8124458cbf0 | [
"MIT"
] | 4 | 2018-10-17T12:18:10.000Z | 2021-05-28T13:24:20.000Z | from SCons.Script import *
| 35.631579 | 111 | 0.643279 | from SCons.Script import *
def exists(env):
return env.Detect('llvm-gcc') and env.Detect('llvm-ld')
def generate(env):
env.SetDefault(LLVMCC='llvm-gcc')
env.SetDefault(LLVMLINK='llvm-ld')
if not exists(env):
print 'Error: Could not find either or both of %s and %s.'%(repr(env['LLVMCC']), repr(... | 1,281 | 0 | 46 |
5c0946952b71037bb1f97ce65af023f47196a25c | 35,474 | py | Python | files/runs_small/cores_2/ocean.cont/power.py | ST4NSB/sniper-simulator-predictions | 1f0fe2a10fda55fceea053464ea202bfe2effafc | [
"MIT"
] | 1 | 2021-03-08T03:39:23.000Z | 2021-03-08T03:39:23.000Z | files/runs_small/cores_2/ocean.cont/power.py | ST4NSB/sniper-simulator-predictions | 1f0fe2a10fda55fceea053464ea202bfe2effafc | [
"MIT"
] | null | null | null | files/runs_small/cores_2/ocean.cont/power.py | ST4NSB/sniper-simulator-predictions | 1f0fe2a10fda55fceea053464ea202bfe2effafc | [
"MIT"
] | null | null | null | power = {'BUSES': {'Area': 1.08752,
'Bus/Area': 1.08752,
'Bus/Gate Leakage': 0.00541455,
'Bus/Peak Dynamic': 0.0,
'Bus/Runtime Dynamic': 0.0,
'Bus/Subthreshold Leakage': 0.0564625,
'Bus/Subthreshold Leakage with power gating': 0.0211734,
'Gate... | 73.59751 | 124 | 0.677398 | power = {'BUSES': {'Area': 1.08752,
'Bus/Area': 1.08752,
'Bus/Gate Leakage': 0.00541455,
'Bus/Peak Dynamic': 0.0,
'Bus/Runtime Dynamic': 0.0,
'Bus/Subthreshold Leakage': 0.0564625,
'Bus/Subthreshold Leakage with power gating': 0.0211734,
'Gate... | 0 | 0 | 0 |
e9a2f6e36e21d2f812a566f6b88b2d9f4025924d | 1,890 | py | Python | app/main.py | alf1e/CHUM-Package-manager | 814290e344c82a8e0fb48435a745b15ae178eefb | [
"MIT"
] | null | null | null | app/main.py | alf1e/CHUM-Package-manager | 814290e344c82a8e0fb48435a745b15ae178eefb | [
"MIT"
] | null | null | null | app/main.py | alf1e/CHUM-Package-manager | 814290e344c82a8e0fb48435a745b15ae178eefb | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#########
#LICENSE#
#########
'''
MIT License
Copyright (c) 2021 ItsMeAlfie0
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitat... | 29.076923 | 78 | 0.691534 | #!/usr/bin/env python
#########
#LICENSE#
#########
'''
MIT License
Copyright (c) 2021 ItsMeAlfie0
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitat... | 0 | 0 | 0 |
10235f4c22917028f59e78a277404007dacc9d74 | 1,058 | py | Python | pin ponge.py | glebyad/ping-pong | 2fabfa00b51f5c50686f8c6de10864722f3d3968 | [
"CC0-1.0"
] | null | null | null | pin ponge.py | glebyad/ping-pong | 2fabfa00b51f5c50686f8c6de10864722f3d3968 | [
"CC0-1.0"
] | null | null | null | pin ponge.py | glebyad/ping-pong | 2fabfa00b51f5c50686f8c6de10864722f3d3968 | [
"CC0-1.0"
] | null | null | null | from pygame import *
#создай окно игры
window = display.set_mode((1000, 700))
display.set_caption('догонялки')
#задай фон сцены
background = transform.scale(image.load('ping.jpg'), (1000, 700))
#создай 2 спрайта и размести их на сцене
x1 = 0
y1 = 300
x2 = 900
y2 = 300
sprite1 = transform.scale(image.lo... | 19.592593 | 66 | 0.571834 | from pygame import *
#создай окно игры
window = display.set_mode((1000, 700))
display.set_caption('догонялки')
#задай фон сцены
background = transform.scale(image.load('ping.jpg'), (1000, 700))
#создай 2 спрайта и размести их на сцене
x1 = 0
y1 = 300
x2 = 900
y2 = 300
sprite1 = transform.scale(image.lo... | 0 | 0 | 0 |
4095a34c413d03e43c4c7d0136819b20e9686d8b | 3,010 | py | Python | containerchaos/measure_response_time.py | containerchaos/containerchaos | 3e44c9587542678d6563b3f07299fb33c88a1f3e | [
"MIT"
] | null | null | null | containerchaos/measure_response_time.py | containerchaos/containerchaos | 3e44c9587542678d6563b3f07299fb33c88a1f3e | [
"MIT"
] | 9 | 2019-02-15T16:59:39.000Z | 2019-02-26T22:42:10.000Z | containerchaos/measure_response_time.py | containerchaos/containerchaos | 3e44c9587542678d6563b3f07299fb33c88a1f3e | [
"MIT"
] | 1 | 2019-07-31T13:38:51.000Z | 2019-07-31T13:38:51.000Z | import csv
import datetime
import matplotlib.pyplot as plt
import pandas as pd
import requests
import seaborn as sns
def measure_response_time(url, criteria, write=True):
'''
Measures and saves an API request's response time to a CSV file
:param url: The URL for API request
:param criteria: The crit... | 32.021277 | 108 | 0.707641 | import csv
import datetime
import matplotlib.pyplot as plt
import pandas as pd
import requests
import seaborn as sns
def measure_response_time(url, criteria, write=True):
'''
Measures and saves an API request's response time to a CSV file
:param url: The URL for API request
:param criteria: The crit... | 0 | 0 | 0 |
821041c230e611989e036de3de8d4f9ba908a39e | 1,620 | py | Python | tracking/main.py | chan-w/vaccine-text-signup | f926aa76724ffd5fe1d473fd6cdb70ed50ee982d | [
"MIT"
] | null | null | null | tracking/main.py | chan-w/vaccine-text-signup | f926aa76724ffd5fe1d473fd6cdb70ed50ee982d | [
"MIT"
] | null | null | null | tracking/main.py | chan-w/vaccine-text-signup | f926aa76724ffd5fe1d473fd6cdb70ed50ee982d | [
"MIT"
] | null | null | null | api_key = "AIzaSyAedPSTmyoW1ejPtwG_cSu7fEjLxOOUrXg"
# Uses the Geocode API
import requests
from urllib.parse import urlencode
#Input address here!
lat, lng = extract_lat_lng("1600 Amphitheatre Parkway, Mountain View, CA")
places_endpoint_2 = "https://maps.googleapis.com/maps/api/place/nearbysearch/json"
params_2 = {... | 27.931034 | 93 | 0.683951 | api_key = "AIzaSyAedPSTmyoW1ejPtwG_cSu7fEjLxOOUrXg"
# Uses the Geocode API
import requests
from urllib.parse import urlencode
def extract_lat_lng(address_or_postalcode, data_type = 'json'):
endpoint = f"https://maps.googleapis.com/maps/api/geocode/{data_type}"
params = {"address": address_or_postalcode, "key":... | 504 | 0 | 23 |
f74c328b4e8be5db4ab0478db22db83a43dfc36e | 38,645 | py | Python | petitions/migrations/01000_add_counties_subcounties_courts_prisons_offences.py | DavidWaichari/pomac | 79273c34dc54a301ed9fd802b0c2c487b2ac5d92 | [
"MIT"
] | null | null | null | petitions/migrations/01000_add_counties_subcounties_courts_prisons_offences.py | DavidWaichari/pomac | 79273c34dc54a301ed9fd802b0c2c487b2ac5d92 | [
"MIT"
] | null | null | null | petitions/migrations/01000_add_counties_subcounties_courts_prisons_offences.py | DavidWaichari/pomac | 79273c34dc54a301ed9fd802b0c2c487b2ac5d92 | [
"MIT"
] | null | null | null | # Generated by Django 2.0.1 on 2018-01-28 19:30
from django.db import migrations
| 56.25182 | 112 | 0.73712 | # Generated by Django 2.0.1 on 2018-01-28 19:30
from django.db import migrations
def add_initial_data(apps, schema_editor):
County = apps.get_model('petitions', 'County')
Court = apps.get_model('petitions', 'Court')
SubCounty = apps.get_model('petitions', 'SubCounty')
Prison = apps.get_model('petit... | 38,364 | 158 | 46 |
36bc8aa73a8f1cabd11099df50981f6ebd187753 | 151 | py | Python | seagulls-engine/src/seagulls/eventing/__init__.py | codeghetti/seagulls-py | fd406a762b63368130125547f53e30672cec6754 | [
"MIT"
] | 2 | 2021-10-17T22:06:30.000Z | 2022-02-10T03:15:56.000Z | seagulls-engine/src/seagulls/eventing/__init__.py | codeghetti/seagulls-py | fd406a762b63368130125547f53e30672cec6754 | [
"MIT"
] | 80 | 2021-10-10T23:45:30.000Z | 2022-03-24T05:18:38.000Z | seagulls-engine/src/seagulls/eventing/__init__.py | codeghetti/seagulls-py | fd406a762b63368130125547f53e30672cec6754 | [
"MIT"
] | null | null | null | from ._interfaces import EventCallbackType, EventType, IDispatchEvents
__all__ = [
"IDispatchEvents",
"EventType",
"EventCallbackType",
]
| 18.875 | 70 | 0.728477 | from ._interfaces import EventCallbackType, EventType, IDispatchEvents
__all__ = [
"IDispatchEvents",
"EventType",
"EventCallbackType",
]
| 0 | 0 | 0 |
cc9ba850fe110e3307316eed60921aa795ab38c8 | 1,443 | py | Python | s11_exception/user_defined.py | chiehandlu/pythonlearn | 53ba8f0f8edc7df7b09b0f233d52d7145d380ec0 | [
"Apache-2.0"
] | 14 | 2017-06-27T06:20:57.000Z | 2020-03-31T11:05:16.000Z | s11_exception/user_defined.py | chiehandlu/pythonlearn | 53ba8f0f8edc7df7b09b0f233d52d7145d380ec0 | [
"Apache-2.0"
] | null | null | null | s11_exception/user_defined.py | chiehandlu/pythonlearn | 53ba8f0f8edc7df7b09b0f233d52d7145d380ec0 | [
"Apache-2.0"
] | 11 | 2017-07-19T07:09:11.000Z | 2020-12-03T19:16:35.000Z | # user defined exception
"""
Exceptions
|
--------------------------------------------
| |
Build-in Exceptions User defined Exceptions
"""
#
# >>> class CustomE... | 22.904762 | 69 | 0.568261 | # user defined exception
"""
Exceptions
|
--------------------------------------------
| |
Build-in Exceptions User defined Exceptions
"""
#
# >>> class CustomE... | 0 | 0 | 0 |
9146722cb396bc3df5b2db84f8905fbbcf01ba0b | 754 | py | Python | Exercicios/PythonExercicios/ex031 - 040/ex036.py | sggrilo/Curso-em-Video-Python | a0e6f3d80d89eb8709345a38e207d81a77891192 | [
"MIT"
] | null | null | null | Exercicios/PythonExercicios/ex031 - 040/ex036.py | sggrilo/Curso-em-Video-Python | a0e6f3d80d89eb8709345a38e207d81a77891192 | [
"MIT"
] | null | null | null | Exercicios/PythonExercicios/ex031 - 040/ex036.py | sggrilo/Curso-em-Video-Python | a0e6f3d80d89eb8709345a38e207d81a77891192 | [
"MIT"
] | null | null | null | # APROVANDO EMPRÉSTIMO — Escreva um programa para aprovar o empréstimo bancário para a compra de uma casa.
# O programa vai perguntar o valor da casa, o salário do comprador e em quantos anos ele vai pagar.
#
# Calcule o valor da prestação mensal, sabendo que ela não pode
# exceder 30% do salário ou então o empréstimo ... | 50.266667 | 106 | 0.717507 | # APROVANDO EMPRÉSTIMO — Escreva um programa para aprovar o empréstimo bancário para a compra de uma casa.
# O programa vai perguntar o valor da casa, o salário do comprador e em quantos anos ele vai pagar.
#
# Calcule o valor da prestação mensal, sabendo que ela não pode
# exceder 30% do salário ou então o empréstimo ... | 0 | 0 | 0 |
68738296ecb89750554f9a476220a0b429e070a3 | 1,568 | py | Python | tests/test_validators.py | markin/elmo-alerting | 7562f8f05acbe9632a2e6c19da72d15c571b9e75 | [
"BSD-3-Clause"
] | null | null | null | tests/test_validators.py | markin/elmo-alerting | 7562f8f05acbe9632a2e6c19da72d15c571b9e75 | [
"BSD-3-Clause"
] | null | null | null | tests/test_validators.py | markin/elmo-alerting | 7562f8f05acbe9632a2e6c19da72d15c571b9e75 | [
"BSD-3-Clause"
] | null | null | null | import pytest
from elmo.settings.exceptions import ValidationError
from elmo.settings.validators import is_https_url, not_null
def test_not_null_boolean():
"""Should succeed with a not None value"""
assert not_null(True) is True
assert not_null(False) is True
def test_not_null_with_string():
"""Sho... | 24.888889 | 59 | 0.700893 | import pytest
from elmo.settings.exceptions import ValidationError
from elmo.settings.validators import is_https_url, not_null
def test_not_null_boolean():
"""Should succeed with a not None value"""
assert not_null(True) is True
assert not_null(False) is True
def test_not_null_with_string():
"""Sho... | 0 | 0 | 0 |
4f384fa3345ec81c2b43e245a99561b679dd309e | 232 | py | Python | tests/functional/test_01_collector.py | PureStorage-OpenConnect/pure-fb-prometheus-exporter | 53fd72a2a858a60d17d4ca4ade1d82540596f9f0 | [
"Apache-2.0"
] | null | null | null | tests/functional/test_01_collector.py | PureStorage-OpenConnect/pure-fb-prometheus-exporter | 53fd72a2a858a60d17d4ca4ade1d82540596f9f0 | [
"Apache-2.0"
] | 2 | 2022-02-15T21:30:25.000Z | 2022-02-16T15:29:48.000Z | tests/functional/test_01_collector.py | PureStorage-OpenConnect/pure-fb-prometheus-exporter | 53fd72a2a858a60d17d4ca4ade1d82540596f9f0 | [
"Apache-2.0"
] | null | null | null | from pure_fb_openmetrics_exporter.flashblade_collector import collector
| 29 | 71 | 0.771552 | from pure_fb_openmetrics_exporter.flashblade_collector import collector
def test_collector_array(fb_client):
coll = collector.FlashbladeCollector(fb_client, request='array')
for s in coll.collect():
print(type(s))
| 137 | 0 | 23 |
b81d65ceb6ca8ece76c3f59d1de081d6ef44cad0 | 375 | py | Python | evernote_oauth_sample/urls.py | FightingJoey/EvernoteOAuth | 5d5cac2feb924d92b222660a6e20b41b4adba0ba | [
"Apache-2.0"
] | null | null | null | evernote_oauth_sample/urls.py | FightingJoey/EvernoteOAuth | 5d5cac2feb924d92b222660a6e20b41b4adba0ba | [
"Apache-2.0"
] | null | null | null | evernote_oauth_sample/urls.py | FightingJoey/EvernoteOAuth | 5d5cac2feb924d92b222660a6e20b41b4adba0ba | [
"Apache-2.0"
] | null | null | null | from django.urls import include, re_path
from oauth import views as oauth_views
urlpatterns = [
re_path(r"^$", oauth_views.index, name="evernote_index"),
re_path(r"^auth/$", oauth_views.auth, name="evernote_auth"),
re_path(r"^callback/$", oauth_views.callback, name="evernote_callback"),
re_path(r"^rese... | 41.666667 | 76 | 0.725333 | from django.urls import include, re_path
from oauth import views as oauth_views
urlpatterns = [
re_path(r"^$", oauth_views.index, name="evernote_index"),
re_path(r"^auth/$", oauth_views.auth, name="evernote_auth"),
re_path(r"^callback/$", oauth_views.callback, name="evernote_callback"),
re_path(r"^rese... | 0 | 0 | 0 |
db7c45d3e242e614455cd42a431b040662ea02b4 | 213 | py | Python | docs/__init__.py | LMSC-NTappy/PyMoDAQ | fb0916422f0fcb9660d804b8cb18ddf745a41ef1 | [
"MIT"
] | 42 | 2019-04-09T09:40:18.000Z | 2022-02-18T09:47:37.000Z | docs/__init__.py | LMSC-NTappy/PyMoDAQ | fb0916422f0fcb9660d804b8cb18ddf745a41ef1 | [
"MIT"
] | 35 | 2019-04-22T19:53:37.000Z | 2022-03-31T16:37:17.000Z | docs/__init__.py | LMSC-NTappy/PyMoDAQ | fb0916422f0fcb9660d804b8cb18ddf745a41ef1 | [
"MIT"
] | 46 | 2019-04-17T08:32:05.000Z | 2022-03-02T16:18:04.000Z | # __all__ = ["DAQ_Move", "DAQ_Navigation_Visu", "DAQ_Utils","DAQ_1DViewer"]
# from .DAQ_move import *
# from .DAQ_Navigation_Visu import *
# from .DAQ_Utils import *
from .DAQ_Utils.plotting.QLED import QLED
| 19.363636 | 75 | 0.732394 | # __all__ = ["DAQ_Move", "DAQ_Navigation_Visu", "DAQ_Utils","DAQ_1DViewer"]
# from .DAQ_move import *
# from .DAQ_Navigation_Visu import *
# from .DAQ_Utils import *
from .DAQ_Utils.plotting.QLED import QLED
| 0 | 0 | 0 |
bfb76dd56bbe4bfd11e57ae5069fb7f5366b0599 | 642 | py | Python | examples/first_example.py | MisterBianco/riff | 25ceda3319b246a52508b71bba42c3ca43312e22 | [
"MIT"
] | null | null | null | examples/first_example.py | MisterBianco/riff | 25ceda3319b246a52508b71bba42c3ca43312e22 | [
"MIT"
] | null | null | null | examples/first_example.py | MisterBianco/riff | 25ceda3319b246a52508b71bba42c3ca43312e22 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
sys.path.append("/home/jacobsin/Development/python/rifflib")
import riff
# contract = riff.make_contract("contract.yml")
riff.endpoint.walker(
[
{
"userId": 1,
"id": 1,
"title": "sunt aut facere repellat provid... | 19.454545 | 98 | 0.451713 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
sys.path.append("/home/jacobsin/Development/python/rifflib")
import riff
# contract = riff.make_contract("contract.yml")
riff.endpoint.walker(
[
{
"userId": 1,
"id": 1,
"title": "sunt aut facere repellat provid... | 0 | 0 | 0 |
d62a7cccc71bd34674485e13574adf185387bab6 | 163 | py | Python | HLTriggerOffline/SMP/python/SMPValidation_cff.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 852 | 2015-01-11T21:03:51.000Z | 2022-03-25T21:14:00.000Z | HLTriggerOffline/SMP/python/SMPValidation_cff.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 30,371 | 2015-01-02T00:14:40.000Z | 2022-03-31T23:26:05.000Z | HLTriggerOffline/SMP/python/SMPValidation_cff.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 3,240 | 2015-01-02T05:53:18.000Z | 2022-03-31T17:24:21.000Z | import FWCore.ParameterSet.Config as cms
from HLTriggerOffline.SMP.hltSMPValidator_cfi import *
SMPValidationSequence = cms.Sequence(
hltSMPValidator
)
| 18.111111 | 54 | 0.797546 | import FWCore.ParameterSet.Config as cms
from HLTriggerOffline.SMP.hltSMPValidator_cfi import *
SMPValidationSequence = cms.Sequence(
hltSMPValidator
)
| 0 | 0 | 0 |
9bff9fef39675adfb373a29d0deaa26a547bac05 | 1,536 | py | Python | runtests.py | guestready/django-currencies | e41402008f50a20cf5eb859833d7825c42619c2b | [
"BSD-3-Clause"
] | 69 | 2015-01-08T09:58:56.000Z | 2021-06-16T12:48:21.000Z | runtests.py | guestready/django-currencies | e41402008f50a20cf5eb859833d7825c42619c2b | [
"BSD-3-Clause"
] | 55 | 2015-01-27T15:03:19.000Z | 2022-03-07T00:59:03.000Z | runtests.py | guestready/django-currencies | e41402008f50a20cf5eb859833d7825c42619c2b | [
"BSD-3-Clause"
] | 58 | 2015-01-06T01:57:11.000Z | 2022-02-28T19:50:43.000Z | #!/usr/bin/env python
import sys
from os import path
import django
from django.conf import settings, global_settings
from django.core.management import execute_from_command_line
MIDDLEWARE = (
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.mi... | 26.482759 | 77 | 0.575521 | #!/usr/bin/env python
import sys
from os import path
import django
from django.conf import settings, global_settings
from django.core.management import execute_from_command_line
MIDDLEWARE = (
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.mi... | 80 | 0 | 23 |
c4f6fa3b74d2181de6e58673eedb06788214f226 | 4,072 | py | Python | Class_2_HardCode.py | diptamath/CIQ-Challenge | 3cdadd1e4688744f58f7449b1b172bd4dccc6331 | [
"MIT"
] | null | null | null | Class_2_HardCode.py | diptamath/CIQ-Challenge | 3cdadd1e4688744f58f7449b1b172bd4dccc6331 | [
"MIT"
] | null | null | null | Class_2_HardCode.py | diptamath/CIQ-Challenge | 3cdadd1e4688744f58f7449b1b172bd4dccc6331 | [
"MIT"
] | 1 | 2021-03-21T07:41:30.000Z | 2021-03-21T07:41:30.000Z |
# coding: utf-8
# In[1]:
from __future__ import absolute_import, division
import os
import time
import numpy as np
import pandas as pd
import gensim
from tqdm import tqdm
from nltk.stem import PorterStemmer
ps = PorterStemmer()
from nltk.stem.lancaster import LancasterStemmer
lc = LancasterStemmer()
from nltk.stem... | 25.772152 | 463 | 0.565324 |
# coding: utf-8
# In[1]:
from __future__ import absolute_import, division
import os
import time
import numpy as np
import pandas as pd
import gensim
from tqdm import tqdm
from nltk.stem import PorterStemmer
ps = PorterStemmer()
from nltk.stem.lancaster import LancasterStemmer
lc = LancasterStemmer()
from nltk.stem... | 1,383 | 0 | 68 |
f4a3fde574f09cda28a8817f7f28452d54ccb890 | 6,267 | py | Python | notebooks/regex_extraction.py | reaganrewop/Keyphrase_extraction_validation | bf0407bf477c89bfb449f6e1ca4a0e5a0601c97d | [
"MIT"
] | null | null | null | notebooks/regex_extraction.py | reaganrewop/Keyphrase_extraction_validation | bf0407bf477c89bfb449f6e1ca4a0e5a0601c97d | [
"MIT"
] | null | null | null | notebooks/regex_extraction.py | reaganrewop/Keyphrase_extraction_validation | bf0407bf477c89bfb449f6e1ca4a0e5a0601c97d | [
"MIT"
] | null | null | null | # ---
# jupyter:
# jupytext:
# text_representation:
# extension: .py
# format_name: light
# format_version: '1.3'
# jupytext_version: 0.8.6
# kernelspec:
# display_name: Python [conda env:DL-wpython3]
# language: python
# name: conda-env-DL-wpython3-py
# ---
import time
impo... | 31.97449 | 300 | 0.62135 | # ---
# jupyter:
# jupytext:
# text_representation:
# extension: .py
# format_name: light
# format_version: '1.3'
# jupytext_version: 0.8.6
# kernelspec:
# display_name: Python [conda env:DL-wpython3]
# language: python
# name: conda-env-DL-wpython3-py
# ---
import time
impo... | 3,179 | 0 | 138 |
953960ffc84adc3d30016015a34adf364d0ca446 | 2,227 | py | Python | main.py | DudeFr0mMars/Economy-Bot | 15111eb032a03eebf9eb9a76b4377c3a6814fa98 | [
"MIT"
] | 30 | 2020-12-20T10:42:42.000Z | 2021-12-18T05:17:58.000Z | main.py | DudeFr0mMars/Economy-Bot | 15111eb032a03eebf9eb9a76b4377c3a6814fa98 | [
"MIT"
] | 11 | 2021-04-08T23:48:24.000Z | 2021-12-16T04:51:34.000Z | main.py | DudeFr0mMars/Economy-Bot | 15111eb032a03eebf9eb9a76b4377c3a6814fa98 | [
"MIT"
] | 43 | 2021-01-28T14:37:10.000Z | 2021-12-17T02:19:40.000Z | from datetime import datetime, timedelta
from os import listdir, system
import aiohttp
import discord
import json
from discord.ext import commands
from pretty_help import PrettyHelp
with open('./data.json') as f:
d1 = json.load(f)
with open('./market.json') as f:
d2 = json.load(f)
TOKEN = d1['token']
bot = Ech... | 25.597701 | 113 | 0.625954 | from datetime import datetime, timedelta
from os import listdir, system
import aiohttp
import discord
import json
from discord.ext import commands
from pretty_help import PrettyHelp
class Echo(commands.Bot):
def __init__(self):
self.description = """Echo - A Economy Bot"""
super().__init__(
... | 1,343 | 4 | 214 |
41b4693fd18fa289244d02060d677bc5ebca5209 | 2,614 | py | Python | PyimageTutorial/Module 4 Image Classification and Machine Learning/Module_4_7_Advanced_Image_Pyramid/David_4_7_2_index_features.py | wcsodw1/Computer-Vision-with-Artificial-intelligence | 1fc58466bf82c33939fae911140737a8d9681ebd | [
"MIT"
] | null | null | null | PyimageTutorial/Module 4 Image Classification and Machine Learning/Module_4_7_Advanced_Image_Pyramid/David_4_7_2_index_features.py | wcsodw1/Computer-Vision-with-Artificial-intelligence | 1fc58466bf82c33939fae911140737a8d9681ebd | [
"MIT"
] | null | null | null | PyimageTutorial/Module 4 Image Classification and Machine Learning/Module_4_7_Advanced_Image_Pyramid/David_4_7_2_index_features.py | wcsodw1/Computer-Vision-with-Artificial-intelligence | 1fc58466bf82c33939fae911140737a8d9681ebd | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Sat Apr 18 13:02:47 2020
@author: user
"""
# python David_4_7_2_index_features.py --dataset output/data/training --features-db output/training_features.hdf5
# python David_4_7_2_index_features.py
# import the necessary packages
from __future__ import print_function
from pyimage... | 33.512821 | 113 | 0.757077 | # -*- coding: utf-8 -*-
"""
Created on Sat Apr 18 13:02:47 2020
@author: user
"""
# python David_4_7_2_index_features.py --dataset output/data/training --features-db output/training_features.hdf5
# python David_4_7_2_index_features.py
# import the necessary packages
from __future__ import print_function
from pyimage... | 0 | 0 | 0 |
589b7b1599bf21d56f84a0ca7d37adf5f0fdf3d9 | 3,247 | py | Python | hw3.py | DrawnWren/nandprogramming | ec67d1babac393c37b33012bc92aa30938367782 | [
"MIT"
] | null | null | null | hw3.py | DrawnWren/nandprogramming | ec67d1babac393c37b33012bc92aa30938367782 | [
"MIT"
] | null | null | null | hw3.py | DrawnWren/nandprogramming | ec67d1babac393c37b33012bc92aa30938367782 | [
"MIT"
] | null | null | null | """ Basic template file that you should fill in for Problem Set 3. Some util
functions are provided from the NAND notebooks online that implement some
of the NAND essentials. """
from util import EVAL
from util import TRUTH
from util import NANDProgram
# TODO: Implement this function and return a string represe... | 41.101266 | 98 | 0.668309 | """ Basic template file that you should fill in for Problem Set 3. Some util
functions are provided from the NAND notebooks online that implement some
of the NAND essentials. """
from util import EVAL
from util import TRUTH
from util import NANDProgram
# TODO: Implement this function and return a string represe... | 0 | 0 | 0 |
ea6c2ca88d47675d9aa8565970ee7ab5480b4ae9 | 2,320 | py | Python | Chapter10/myproject_docker/apps/movies/migrations/0001_initial.py | PacktPublishing/Django-2-Web-Development-Cookbook-Third-Edition | f129613e2b1d00f5c76649025ae4d568f6286f2c | [
"MIT"
] | 75 | 2018-12-03T02:35:29.000Z | 2021-11-08T13:13:34.000Z | Chapter10/virtualenvs/myproject_env/project/django-myproject/movies/migrations/0001_initial.py | PacktPublishing/Django-2-Web-Development-Cookbook-Third-Edition | f129613e2b1d00f5c76649025ae4d568f6286f2c | [
"MIT"
] | 3 | 2019-08-11T13:35:01.000Z | 2020-09-29T06:52:36.000Z | Chapter08/virtualenvs/myproject_env/project/django-myproject/movies/migrations/0001_initial.py | PacktPublishing/Django-2-Web-Development-Cookbook-Third-Edition | f129613e2b1d00f5c76649025ae4d568f6286f2c | [
"MIT"
] | 45 | 2018-11-03T14:03:22.000Z | 2021-08-25T07:39:33.000Z | # Generated by Django 2.1.1 on 2018-09-16 08:39
from django.db import migrations, models
| 42.962963 | 280 | 0.515517 | # Generated by Django 2.1.1 on 2018-09-16 08:39
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Actor',
fields=[
('id', models.AutoField(au... | 0 | 2,406 | 23 |
4d880e3e2d2a468a977f492e0eda5c5352ab890e | 165 | py | Python | overlays/alt_s.py | werpu/emulation_tools | 8293fbf566c66362fc7238cacdea118da5b86d9d | [
"MIT"
] | null | null | null | overlays/alt_s.py | werpu/emulation_tools | 8293fbf566c66362fc7238cacdea118da5b86d9d | [
"MIT"
] | 4 | 2020-10-06T14:49:27.000Z | 2021-08-31T19:07:47.000Z | overlays/alt_s.py | werpu/emulation_tools | 8293fbf566c66362fc7238cacdea118da5b86d9d | [
"MIT"
] | null | null | null | # save snapshot
from evdev import UInput, ecodes
cfg = globals()["config"]
drv = globals()["drivers"]["keybd1"]
drv.press_keys(ecodes.KEY_LEFTALT, ecodes.KEY_S)
| 16.5 | 48 | 0.721212 | # save snapshot
from evdev import UInput, ecodes
cfg = globals()["config"]
drv = globals()["drivers"]["keybd1"]
drv.press_keys(ecodes.KEY_LEFTALT, ecodes.KEY_S)
| 0 | 0 | 0 |
99a3846b765e385bd108d18e68d7d370aff0fbab | 951 | py | Python | src/rfdoc/rfdocapp/utils/__init__.py | elrandira/rfdoc | 23a5f510f6cd74362982253268f19700b4a1acf4 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | src/rfdoc/rfdocapp/utils/__init__.py | elrandira/rfdoc | 23a5f510f6cd74362982253268f19700b4a1acf4 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | src/rfdoc/rfdocapp/utils/__init__.py | elrandira/rfdoc | 23a5f510f6cd74362982253268f19700b4a1acf4 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2022-02-01T16:08:43.000Z | 2022-02-01T16:08:43.000Z | # Copyright 2009-2013 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 31.7 | 74 | 0.727655 | # Copyright 2009-2013 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 224 | 0 | 69 |
fad42a2176634bf90465a537b384408b95236de7 | 637 | py | Python | algorthm/tests/test_Search.py | dinaklal/algorthm | 5adc65ba3eecb4d60b0193ff8d237828c621701b | [
"MIT"
] | 1 | 2019-08-16T10:17:56.000Z | 2019-08-16T10:17:56.000Z | algorthm/tests/test_Search.py | dinaklal/algorthm | 5adc65ba3eecb4d60b0193ff8d237828c621701b | [
"MIT"
] | 3 | 2019-08-09T13:02:21.000Z | 2019-08-13T13:35:04.000Z | algorthm/tests/test_Search.py | dinaklal/algorthm | 5adc65ba3eecb4d60b0193ff8d237828c621701b | [
"MIT"
] | 1 | 2019-08-20T10:23:24.000Z | 2019-08-20T10:23:24.000Z | import pytest
import sys
sys.path.append('../')
from search import *
| 22.75 | 37 | 0.621664 | import pytest
import sys
sys.path.append('../')
from search import *
def test_linearSearch():
a= linearSearch([1,3,2],2)
assert a == 2
def test_binarySearch():
a= binarySearch([1,3,2],3)
assert a == 1
def test_binarySearch_2():
a= binarySearch([1,3,2,4,5,6],4)
assert a == 4
def test_jumpSearch()... | 407 | 0 | 154 |
0f57c0b03feb328d03ec6bdf4966a6d4ecf49694 | 1,609 | py | Python | src/foreign_if/python/main/python/frovedis/dataframe/info.py | wmeddie/frovedis | c134e5e64114799cc7c265c72525ff98d06b49c1 | [
"BSD-2-Clause"
] | null | null | null | src/foreign_if/python/main/python/frovedis/dataframe/info.py | wmeddie/frovedis | c134e5e64114799cc7c265c72525ff98d06b49c1 | [
"BSD-2-Clause"
] | null | null | null | src/foreign_if/python/main/python/frovedis/dataframe/info.py | wmeddie/frovedis | c134e5e64114799cc7c265c72525ff98d06b49c1 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python
from ..exrpc.rpclib import *
from ..exrpc.server import *
from ..mllib.model_util import ModelID
class df_to_sparse_info:
'''A python container for holding information related to dataframe to sparse conversion'''
| 35.755556 | 92 | 0.715351 | #!/usr/bin/env python
from ..exrpc.rpclib import *
from ..exrpc.server import *
from ..mllib.model_util import ModelID
class df_to_sparse_info:
'''A python container for holding information related to dataframe to sparse conversion'''
def __init__(cls,info_id):
cls.__uid = info_id
def load(cls,dirname):
... | 1,239 | 0 | 125 |
b9c0f6e6f3476e8f124a63b6175df5b29e5eaadf | 655 | py | Python | recipes/migrations/0018_auto_20200912_1906.py | sh4rpy/foodgram | 4ebc9655f9a68e05ebb83e7f2f2a2e04128d6713 | [
"BSD-3-Clause"
] | null | null | null | recipes/migrations/0018_auto_20200912_1906.py | sh4rpy/foodgram | 4ebc9655f9a68e05ebb83e7f2f2a2e04128d6713 | [
"BSD-3-Clause"
] | 9 | 2021-04-08T20:01:45.000Z | 2022-03-12T00:48:46.000Z | recipes/migrations/0018_auto_20200912_1906.py | sh4rpy/foodgram | 4ebc9655f9a68e05ebb83e7f2f2a2e04128d6713 | [
"BSD-3-Clause"
] | null | null | null | # Generated by Django 3.1.1 on 2020-09-12 19:06
from django.db import migrations
import multiselectfield.db.fields
| 27.291667 | 196 | 0.60458 | # Generated by Django 3.1.1 on 2020-09-12 19:06
from django.db import migrations
import multiselectfield.db.fields
class Migration(migrations.Migration):
dependencies = [
('recipes', '0017_auto_20200912_1902'),
]
operations = [
migrations.RemoveField(
model_name='recipe',
... | 0 | 534 | 23 |
ad6f36bacc15247857315b4e0c0bbba3891346ae | 14,122 | py | Python | tests/test_validate.py | vmagamedov/harness | 0e9d64295f937aa4476dbe5f084e80a3783edce7 | [
"BSD-3-Clause"
] | 6 | 2020-03-26T16:49:54.000Z | 2022-01-13T09:13:40.000Z | tests/test_validate.py | vmagamedov/harness | 0e9d64295f937aa4476dbe5f084e80a3783edce7 | [
"BSD-3-Clause"
] | 1 | 2020-03-14T16:47:51.000Z | 2020-03-14T16:47:51.000Z | tests/test_validate.py | vmagamedov/harness | 0e9d64295f937aa4476dbe5f084e80a3783edce7 | [
"BSD-3-Clause"
] | null | null | null | import re
from ipaddress import ip_address
import pytest
from harness.runtime._validate import validate, ValidationError
@pytest.fixture()
@pytest.fixture()
@pytest.fixture()
@pytest.fixture()
def test_disabled(message_type):
"""
message Message {
message Inner {
option (validate... | 31.382222 | 113 | 0.652599 | import re
from ipaddress import ip_address
import pytest
from harness.runtime._validate import validate, ValidationError
@pytest.fixture()
def message_type(message_types, package):
return message_types[f"{package}.Message"]
@pytest.fixture()
def timestamp_type(message_types):
return message_types["google.... | 254 | 0 | 88 |
cba4882f9db73bfaee8807536b229122656e0814 | 16,021 | py | Python | alipy/experiment/state_io.py | JlsBssmnn/ALiPy | 57f5a1e4c0252436ecf2572da6973d054807add5 | [
"BSD-3-Clause"
] | 1 | 2021-08-17T01:58:14.000Z | 2021-08-17T01:58:14.000Z | alipy/experiment/state_io.py | JlsBssmnn/ALiPy | 57f5a1e4c0252436ecf2572da6973d054807add5 | [
"BSD-3-Clause"
] | null | null | null | alipy/experiment/state_io.py | JlsBssmnn/ALiPy | 57f5a1e4c0252436ecf2572da6973d054807add5 | [
"BSD-3-Clause"
] | 1 | 2019-12-19T07:02:07.000Z | 2019-12-19T07:02:07.000Z | """
StateIO
Container to store state object.
Several useful functions are implemented in this class:
1. Saving intermediate results to files.
2. Recover workspace at any iteration (label set and unlabel set).
3. Recover workspace from the intermediate result file in case the program exits unexpectedly.
4. Gathering and... | 36.661327 | 190 | 0.603708 | """
StateIO
Container to store state object.
Several useful functions are implemented in this class:
1. Saving intermediate results to files.
2. Recover workspace at any iteration (label set and unlabel set).
3. Recover workspace from the intermediate result file in case the program exits unexpectedly.
4. Gathering and... | 3,429 | 0 | 189 |
95d77119937afbad81cc3276b13c8dbe68d86a97 | 660 | py | Python | eval/cp.py | 1asso/TOM-Net | ba13bd3f1bac0fa50c6043290691d7be5c29f777 | [
"MIT"
] | 1 | 2020-06-25T22:45:46.000Z | 2020-06-25T22:45:46.000Z | eval/cp.py | 1asso/TOM-Net | ba13bd3f1bac0fa50c6043290691d7be5c29f777 | [
"MIT"
] | null | null | null | eval/cp.py | 1asso/TOM-Net | ba13bd3f1bac0fa50c6043290691d7be5c29f777 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import re
import os
import torch
import torch.nn.functional as F
import struct
import glob
from PIL import Image
import torchvision.transforms.functional as TF
from shutil import copyfile
root_dir = ''
ori_dir = ''
if __name__ == '__main__':
sub_dir = [os.path.join(root_dir, name) for name in... | 21.290323 | 121 | 0.681818 | #!/usr/bin/env python3
import re
import os
import torch
import torch.nn.functional as F
import struct
import glob
from PIL import Image
import torchvision.transforms.functional as TF
from shutil import copyfile
root_dir = ''
ori_dir = ''
if __name__ == '__main__':
sub_dir = [os.path.join(root_dir, name) for name in... | 0 | 0 | 0 |
80089fb785b3a1570d67b41953f2b6e2198dc3df | 7,003 | py | Python | vap_turn_taking/backchannel.py | ErikEkstedt/vad_turn_taking | c24e0ddfe9c739328872310e56f4b8c17f82c92c | [
"MIT"
] | null | null | null | vap_turn_taking/backchannel.py | ErikEkstedt/vad_turn_taking | c24e0ddfe9c739328872310e56f4b8c17f82c92c | [
"MIT"
] | null | null | null | vap_turn_taking/backchannel.py | ErikEkstedt/vad_turn_taking | c24e0ddfe9c739328872310e56f4b8c17f82c92c | [
"MIT"
] | null | null | null | import torch
from vap_turn_taking.utils import find_island_idx_len
from vap_turn_taking.hold_shifts import get_dialog_states, get_last_speaker
def find_isolated_within(vad, prefix_frames, max_duration_frames, suffix_frames):
"""
... <= prefix_frames (silence) | <= max_duration_frames (active) | <= suffix_fram... | 36.857895 | 118 | 0.553049 | import torch
from vap_turn_taking.utils import find_island_idx_len
from vap_turn_taking.hold_shifts import get_dialog_states, get_last_speaker
def find_isolated_within(vad, prefix_frames, max_duration_frames, suffix_frames):
"""
... <= prefix_frames (silence) | <= max_duration_frames (active) | <= suffix_fram... | 1,307 | 3,505 | 23 |
0d21441157a5bcd0f69a92c179cb9be376ab1a78 | 190 | py | Python | SUIBE_DID_Data_Manager/blueprints/data_manager/models.py | SUIBE-Blockchain/SUIBE_DID_Data_Manager | d38f3f37463f36802eb6acb578f8e17faf878c79 | [
"MIT"
] | null | null | null | SUIBE_DID_Data_Manager/blueprints/data_manager/models.py | SUIBE-Blockchain/SUIBE_DID_Data_Manager | d38f3f37463f36802eb6acb578f8e17faf878c79 | [
"MIT"
] | 2 | 2020-10-21T07:05:43.000Z | 2020-10-22T17:10:53.000Z | SUIBE_DID_Data_Manager/blueprints/data_manager/models.py | SUIBE-Blockchain/SUIBE_DID_Data_Manager | d38f3f37463f36802eb6acb578f8e17faf878c79 | [
"MIT"
] | null | null | null | import datetime as dt
from flask_login import UserMixin
from SUIBE_DID_Data_Manager.database import (
Column,
Model,
SurrogatePK,
db,
reference_col,
relationship,
) | 15.833333 | 45 | 0.721053 | import datetime as dt
from flask_login import UserMixin
from SUIBE_DID_Data_Manager.database import (
Column,
Model,
SurrogatePK,
db,
reference_col,
relationship,
) | 0 | 0 | 0 |
cd7c1b16a2fe7d789b8f3a8bfd1cd2fda50d36ec | 2,000 | py | Python | base_app.py | loblab/resouce-simulator | a3d62f32ec1f377548519e7aa4eaef10d5bdd0c2 | [
"Apache-2.0"
] | 1 | 2019-12-09T01:28:17.000Z | 2019-12-09T01:28:17.000Z | base_app.py | loblab/resouce-simulator | a3d62f32ec1f377548519e7aa4eaef10d5bdd0c2 | [
"Apache-2.0"
] | null | null | null | base_app.py | loblab/resouce-simulator | a3d62f32ec1f377548519e7aa4eaef10d5bdd0c2 | [
"Apache-2.0"
] | 1 | 2019-12-09T01:28:19.000Z | 2019-12-09T01:28:19.000Z | import argparse
import signal
import time
import sys
import os
import logging
| 28.169014 | 105 | 0.5835 | import argparse
import signal
import time
import sys
import os
import logging
class BaseApp:
def __init__(self, id, description):
signal.signal(signal.SIGINT, self.sig_handler)
signal.signal(signal.SIGTERM, self.sig_handler)
self.quit_flag = False
sfile = sys.argv[0]
ver = ... | 1,662 | -7 | 266 |
f03ed12e66ae135f1cc8f9ec76a8ec9bbe0ca691 | 1,468 | py | Python | iv/Binarysearch_strings/rotated_search_array.py | iamsuman/iv | bf68d3fd45455b6041e74b09272f69503bf7a8ac | [
"MIT"
] | 2 | 2020-09-19T22:28:15.000Z | 2020-10-03T01:44:53.000Z | iv/Binarysearch_strings/rotated_search_array.py | iamsuman/iv | bf68d3fd45455b6041e74b09272f69503bf7a8ac | [
"MIT"
] | null | null | null | iv/Binarysearch_strings/rotated_search_array.py | iamsuman/iv | bf68d3fd45455b6041e74b09272f69503bf7a8ac | [
"MIT"
] | 1 | 2020-10-03T01:43:30.000Z | 2020-10-03T01:43:30.000Z |
A = [4, 5, 6, 7, 0, 1, 2, 3]
A = [0,1,2,3,4,5,6,7]
B = 4
A = [ 101, 103, 106, 109, 158, 164, 182, 187, 202, 205, 2, 3, 32, 57, 69, 74, 81, 99, 100 ]
B = 202
a = Rotated_Search()
print(a.search(A, B))
| 25.310345 | 91 | 0.44891 | class Rotated_Search():
def search(self, A, B):
n = len(A)
pivot = self.find_pivot(A, 0, n - 1)
# A = [4, 5, 6, 7, 0, 1, 2, 3]
# B = 4
# print(pivot)
if pivot == -1:
return self.binary_search(A, 0, n - 1, B)
if A[pivot] == B:
return p... | 1,160 | 2 | 102 |
5ffc54c364f831310a5bc6f460542db448a8e796 | 16,997 | py | Python | mesohops/dynamics/hops_aux.py | MesoscienceLab/mesohops | b845dc61e65af158382a47c4894c3875e05f09e1 | [
"MIT"
] | 7 | 2020-08-17T03:39:42.000Z | 2022-02-10T22:55:55.000Z | mesohops/dynamics/hops_aux.py | MesoscienceLab/mesohops | b845dc61e65af158382a47c4894c3875e05f09e1 | [
"MIT"
] | null | null | null | mesohops/dynamics/hops_aux.py | MesoscienceLab/mesohops | b845dc61e65af158382a47c4894c3875e05f09e1 | [
"MIT"
] | 1 | 2021-07-26T02:11:16.000Z | 2021-07-26T02:11:16.000Z | import numpy as np
from collections.abc import Mapping
from mesohops.util.exceptions import AuxError
from scipy.special import binom
__title__ = "AuxiliaryVector Class"
__author__ = "D. I. G. Bennett"
__version__ = "1.0"
class AuxiliaryVector(Mapping):
"""
This is a class that encodes a sparse representation... | 30.735986 | 91 | 0.526681 | import numpy as np
from collections.abc import Mapping
from mesohops.util.exceptions import AuxError
from scipy.special import binom
__title__ = "AuxiliaryVector Class"
__author__ = "D. I. G. Bennett"
__version__ = "1.0"
class AuxiliaryVector(Mapping):
"""
This is a class that encodes a sparse representation... | 892 | 0 | 373 |
de1f45d8e5aa67310bfd559a5f88a213e3a1cf2f | 523 | py | Python | add_user.py | dev-johnlopez/offerly | 3d53e64747555318addd35b94b5674e1c3ad99d0 | [
"MIT"
] | null | null | null | add_user.py | dev-johnlopez/offerly | 3d53e64747555318addd35b94b5674e1c3ad99d0 | [
"MIT"
] | null | null | null | add_user.py | dev-johnlopez/offerly | 3d53e64747555318addd35b94b5674e1c3ad99d0 | [
"MIT"
] | null | null | null | import os
from app import create_app, db, cli
from flask import current_app
from flask_security import Security, SQLAlchemyUserDatastore, current_user
from flask_security.utils import encrypt_password
from app.auth.models import Role, User
# Setup Flask-Security
app = create_app()
with app.app_context():
user_datas... | 40.230769 | 131 | 0.806883 | import os
from app import create_app, db, cli
from flask import current_app
from flask_security import Security, SQLAlchemyUserDatastore, current_user
from flask_security.utils import encrypt_password
from app.auth.models import Role, User
# Setup Flask-Security
app = create_app()
with app.app_context():
user_datas... | 0 | 0 | 0 |
741e3c39db2ab2880fc0332e1af0e3b72810ce23 | 776 | py | Python | tests/test_position_weight_matrix.py | knutdrand/bionumpy | 2a520ebfce19f346284bd5cf21d6197f6ba801ba | [
"MIT"
] | null | null | null | tests/test_position_weight_matrix.py | knutdrand/bionumpy | 2a520ebfce19f346284bd5cf21d6197f6ba801ba | [
"MIT"
] | null | null | null | tests/test_position_weight_matrix.py | knutdrand/bionumpy | 2a520ebfce19f346284bd5cf21d6197f6ba801ba | [
"MIT"
] | 1 | 2022-03-07T21:58:03.000Z | 2022-03-07T21:58:03.000Z | import pytest
import numpy as np
from bionumpy.position_weight_matrix import PositionWeightMatrix
@pytest.fixture
@pytest.fixture
@pytest.fixture
| 22.171429 | 77 | 0.632732 | import pytest
import numpy as np
from bionumpy.position_weight_matrix import PositionWeightMatrix
@pytest.fixture
def matrix():
with np.errstate(divide='ignore'):
m = np.log([[0.4, 0.25],
[0.1, 0.25],
[0.4, 0.25],
[0.1, 0.25]])
return m
@p... | 509 | 0 | 112 |
7489252a415aa1b1e78068fe1fc7e8079693d7fd | 690 | py | Python | src/script.py | FabricioCrespo/fairMOT_simple | d3be761935c09a37493cb86f6bfd08504c380563 | [
"MIT"
] | 19 | 2020-07-31T07:22:32.000Z | 2022-02-28T10:00:23.000Z | src/script.py | FabricioCrespo/fairMOT_simple | d3be761935c09a37493cb86f6bfd08504c380563 | [
"MIT"
] | 7 | 2020-09-26T14:49:16.000Z | 2022-03-12T00:38:08.000Z | src/script.py | FabricioCrespo/fairMOT_simple | d3be761935c09a37493cb86f6bfd08504c380563 | [
"MIT"
] | 14 | 2020-09-11T19:39:38.000Z | 2021-10-11T12:57:55.000Z | import argparse
from track import *
parser = argparse.ArgumentParser()
parser.add_argument('-mp','--model_path',help='path to model',type=str)
parser.add_argument('-vp','--video_path',help='path to the video',type=str)
parser.add_argument('-od','--output_dir',help='path to save the video',type=str)
if __name__=='_... | 28.75 | 80 | 0.704348 | import argparse
from track import *
parser = argparse.ArgumentParser()
parser.add_argument('-mp','--model_path',help='path to model',type=str)
parser.add_argument('-vp','--video_path',help='path to the video',type=str)
parser.add_argument('-od','--output_dir',help='path to save the video',type=str)
if __name__=='_... | 0 | 0 | 0 |
2bf5f9ed6b0ed77069900efcb2b23bd2ce0282f2 | 1,921 | py | Python | python-packages/pyRiemann-0.2.2/tests/test_clustering.py | rajegannathan/grasp-lift-eeg-cat-dog-solution-updated | ee45bee6f96cdb6d91184abc16f41bba1546c943 | [
"BSD-3-Clause"
] | 2 | 2017-08-13T14:09:32.000Z | 2018-07-16T23:39:00.000Z | python-packages/pyRiemann-0.2.2/tests/test_clustering.py | rajegannathan/grasp-lift-eeg-cat-dog-solution-updated | ee45bee6f96cdb6d91184abc16f41bba1546c943 | [
"BSD-3-Clause"
] | null | null | null | python-packages/pyRiemann-0.2.2/tests/test_clustering.py | rajegannathan/grasp-lift-eeg-cat-dog-solution-updated | ee45bee6f96cdb6d91184abc16f41bba1546c943 | [
"BSD-3-Clause"
] | 2 | 2018-04-02T06:45:11.000Z | 2018-07-16T23:39:02.000Z | import numpy as np
from pyriemann.clustering import Kmeans,KmeansPerClassTransform
def generate_cov(Nt,Ne):
"""Generate a set of cavariances matrices for test purpose"""
diags = 1.0+0.1*np.random.randn(Nt,Ne)
covmats = np.empty((Nt,Ne,Ne))
for i in range(Nt):
covmats[i] = np.diag(diags[i])
... | 26.680556 | 65 | 0.647579 | import numpy as np
from pyriemann.clustering import Kmeans,KmeansPerClassTransform
def generate_cov(Nt,Ne):
"""Generate a set of cavariances matrices for test purpose"""
diags = 1.0+0.1*np.random.randn(Nt,Ne)
covmats = np.empty((Nt,Ne,Ne))
for i in range(Nt):
covmats[i] = np.diag(diags[i])
... | 0 | 0 | 0 |
62b11e6c5da0cc2133a92ea451b6649128fcb41b | 51,262 | py | Python | raphael/utils/net.py | major1201/raphael | 18d7060834be7645b66144ba2a1638f3e1db2dd2 | [
"MIT"
] | null | null | null | raphael/utils/net.py | major1201/raphael | 18d7060834be7645b66144ba2a1638f3e1db2dd2 | [
"MIT"
] | null | null | null | raphael/utils/net.py | major1201/raphael | 18d7060834be7645b66144ba2a1638f3e1db2dd2 | [
"MIT"
] | null | null | null | # encoding= utf-8
from __future__ import division, absolute_import, with_statement, print_function
import requests
def download_file(url, file_path, params=None, proxies=None, request_session=None, cookies=None):
"""
proxies = {
"http": "http://10.10.1.10:3128",
"https": "http://10.10.1.10:1080",
... | 70.030055 | 145 | 0.635324 | # encoding= utf-8
from __future__ import division, absolute_import, with_statement, print_function
import requests
def download_file(url, file_path, params=None, proxies=None, request_session=None, cookies=None):
"""
proxies = {
"http": "http://10.10.1.10:3128",
"https": "http://10.10.1.10:1080",
... | 50,482 | 0 | 115 |
a6f3000b839dcc7f905743f2233883d51f46e361 | 709 | py | Python | tests/test_runeterra_api.py | scary987/twisted_fate | 654120e2a03faa5bc5568c4264beddca31e43a31 | [
"MIT"
] | 13 | 2019-11-22T03:59:08.000Z | 2021-05-25T22:17:53.000Z | tests/test_runeterra_api.py | scary987/twisted_fate | 654120e2a03faa5bc5568c4264beddca31e43a31 | [
"MIT"
] | 7 | 2019-10-25T16:16:33.000Z | 2021-02-25T04:30:36.000Z | tests/test_runeterra_api.py | Snowcola/runeterra | 744b6c777ebdfdf8f07c5c699f63462152aca947 | [
"MIT"
] | 5 | 2020-02-05T17:00:55.000Z | 2021-01-18T06:25:22.000Z | from twisted_fate import __version__
| 22.870968 | 67 | 0.468265 | from twisted_fate import __version__
def test_version():
assert __version__ == '0.1.3'
def test_deck():
import twisted_fate as api
deck = {
"DeckCode": "CEBAGAIDCQRSOCQBAQAQYDISDQTCOKBNGQAACAIBAMFQ",
"CardsInDeck": {
"01NX020": 3,
"01NX035": 3,
"01NX0... | 625 | 0 | 46 |
195a25357f476fe8e429e196a9bdfe546f4e7d79 | 984 | py | Python | tests/test_executor.py | wyriwyd/wyriwyd | 8c011cd02a3499b60b71486f210869e0971793e2 | [
"BSD-3-Clause"
] | 7 | 2019-04-03T12:40:38.000Z | 2019-04-03T20:55:41.000Z | tests/test_executor.py | wyriwyd/wyriwyd | 8c011cd02a3499b60b71486f210869e0971793e2 | [
"BSD-3-Clause"
] | 12 | 2019-04-03T09:18:20.000Z | 2019-04-08T09:20:44.000Z | tests/test_executor.py | wyriwyd/wyriwyd | 8c011cd02a3499b60b71486f210869e0971793e2 | [
"BSD-3-Clause"
] | 1 | 2019-04-03T09:33:32.000Z | 2019-04-03T09:33:32.000Z | import os
from wyriwyd.executor import ShellExecutor
| 29.818182 | 66 | 0.595528 | import os
from wyriwyd.executor import ShellExecutor
def test_executor(tmpdir):
cmds = ["export MY_VARIABLE='hello world'",
"cd {}".format(str(tmpdir)),
"pwd",
"echo MY_VARIABLE = $MY_VARIABLE",
"pushd ../ \n pwd \n popd"]
outputs = []
with ShellExecutor() ... | 883 | 0 | 46 |
0096ee546ed0b0057c7f17a668314161d5695b54 | 11,196 | py | Python | astroduet/duet_telescope.py | bwgref/duet-astro | 4fe3358bb927c0f03de1b75c01ddf2379b5771b3 | [
"BSD-3-Clause"
] | 1 | 2019-04-15T21:02:57.000Z | 2019-04-15T21:02:57.000Z | astroduet/duet_telescope.py | bwgref/duet-astro | 4fe3358bb927c0f03de1b75c01ddf2379b5771b3 | [
"BSD-3-Clause"
] | null | null | null | astroduet/duet_telescope.py | bwgref/duet-astro | 4fe3358bb927c0f03de1b75c01ddf2379b5771b3 | [
"BSD-3-Clause"
] | 1 | 2019-04-17T19:46:42.000Z | 2019-04-17T19:46:42.000Z | import os
curdir = os.path.dirname(__file__)
datadir = os.path.join(curdir, 'data')
def load_telescope_parameters(version, **kwargs):
"""
Utility script to load the telescope parameters
version = 0: Pre-design version (to compare with Rick's stuff)
version = 1: 210 mm design
version = 2: 300 mm... | 24.445415 | 87 | 0.575473 | import os
curdir = os.path.dirname(__file__)
datadir = os.path.join(curdir, 'data')
def load_telescope_parameters(version, **kwargs):
"""
Utility script to load the telescope parameters
version = 0: Pre-design version (to compare with Rick's stuff)
version = 1: 210 mm design
version = 2: 300 mm... | 0 | 0 | 0 |
43d9adbbb5040d1c28b04d0a61b25bd07c383123 | 48 | py | Python | collada_wt/__init__.py | charlie9578/wind-turbine-kml | 297b3d25672e82456485387bbb4e9a97873cf136 | [
"BSD-3-Clause"
] | null | null | null | collada_wt/__init__.py | charlie9578/wind-turbine-kml | 297b3d25672e82456485387bbb4e9a97873cf136 | [
"BSD-3-Clause"
] | null | null | null | collada_wt/__init__.py | charlie9578/wind-turbine-kml | 297b3d25672e82456485387bbb4e9a97873cf136 | [
"BSD-3-Clause"
] | null | null | null | from collada_wt.collada_wt import create_turbine | 48 | 48 | 0.916667 | from collada_wt.collada_wt import create_turbine | 0 | 0 | 0 |
056b231605a31182c39245326f875993e680cc1d | 4,073 | py | Python | model/backbone.py | PaperCodeReview/DETR-TF | 8f9fc3e06c20269044967718847c794606e25d10 | [
"MIT"
] | 3 | 2020-10-01T10:15:46.000Z | 2021-04-20T03:33:00.000Z | model/backbone.py | PaperCodeReview/DETR-TF | 8f9fc3e06c20269044967718847c794606e25d10 | [
"MIT"
] | null | null | null | model/backbone.py | PaperCodeReview/DETR-TF | 8f9fc3e06c20269044967718847c794606e25d10 | [
"MIT"
] | null | null | null | from typing import Dict
import tensorflow as tf
from model.position_encoding import build_position_encoding
| 37.027273 | 101 | 0.558802 | from typing import Dict
import tensorflow as tf
from model.position_encoding import build_position_encoding
class FrozenBatchNorm2D(tf.keras.layers.Layer):
def __init__(self, **kwargs):
super(FrozenBatchNorm2D, self).__init__(**kwargs)
def build(self, input_shape):
self.weight = sel... | 3,537 | 56 | 360 |
9e39e0c0c35e473517bcf3aa9aba3fd648b29f77 | 472 | py | Python | urls.py | zachsnyder1/geopost | 067c79b24deb0b99477513c5d684f6ac92d60dbe | [
"MIT"
] | 1 | 2016-04-22T20:35:31.000Z | 2016-04-22T20:35:31.000Z | urls.py | zachsnyder1/geopost | 067c79b24deb0b99477513c5d684f6ac92d60dbe | [
"MIT"
] | null | null | null | urls.py | zachsnyder1/geopost | 067c79b24deb0b99477513c5d684f6ac92d60dbe | [
"MIT"
] | null | null | null | from django.urls import re_path
from . import views
urlpatterns = [
re_path(r'^$', views.Home.as_view(), name='geopost_home'),
re_path(r'^entry/$', views.Entry.as_view(), name='geopost_entry'),
re_path(r'^photo/(?P<entry_uuid>[0-9A-Fa-f-]+)$',
views.photo,
name="geopost_... | 36.307692 | 74 | 0.612288 | from django.urls import re_path
from . import views
urlpatterns = [
re_path(r'^$', views.Home.as_view(), name='geopost_home'),
re_path(r'^entry/$', views.Entry.as_view(), name='geopost_entry'),
re_path(r'^photo/(?P<entry_uuid>[0-9A-Fa-f-]+)$',
views.photo,
name="geopost_... | 0 | 0 | 0 |
1dc2c031015cfc8534eb01331cac24b95caf681f | 2,752 | py | Python | flaskexerc/deptoDAO.py | adrianpastore/LoginDS2 | ea126fadd31c97ffea048a3a85ebd45f9c383ad9 | [
"MIT"
] | null | null | null | flaskexerc/deptoDAO.py | adrianpastore/LoginDS2 | ea126fadd31c97ffea048a3a85ebd45f9c383ad9 | [
"MIT"
] | null | null | null | flaskexerc/deptoDAO.py | adrianpastore/LoginDS2 | ea126fadd31c97ffea048a3a85ebd45f9c383ad9 | [
"MIT"
] | null | null | null | from depto import departamento
import psycopg2
#except ValueError:
# print('Valor não encontrado.')
#except psycopg2.Error as e:
# print(e.pgerror)
| 37.69863 | 180 | 0.555959 | from depto import departamento
import psycopg2
class deptoDao:
def __init__(self):
self._dados_con = "dbname=ds2aula host=localhost user=postgres password=postgres port=5432"
def inserir(self, departamento):
with psycopg2.connect(self._dados_con) as conn:
cur = conn.cursor(... | 2,357 | -6 | 215 |
2d9493708a911e3f5dcfd12ee156d4f59611ca4e | 72 | py | Python | datasette/version.py | jefftriplett/datasette | 1a30fc259205df736daf068c57a0a6ae2c21ffa9 | [
"Apache-2.0"
] | 1 | 2020-11-03T17:40:11.000Z | 2020-11-03T17:40:11.000Z | datasette/version.py | Quentinchampenois/datasette | 13d1228d80c91d382a05b1a9549ed02c300ef851 | [
"Apache-2.0"
] | null | null | null | datasette/version.py | Quentinchampenois/datasette | 13d1228d80c91d382a05b1a9549ed02c300ef851 | [
"Apache-2.0"
] | null | null | null | __version__ = "0.51.1"
__version_info__ = tuple(__version__.split("."))
| 24 | 48 | 0.722222 | __version__ = "0.51.1"
__version_info__ = tuple(__version__.split("."))
| 0 | 0 | 0 |
480bbce3a19feff8809ef78418436457fe3a997c | 1,994 | py | Python | rmrb/rmrb_daemon/modules/xorg_monitor.py | fjfhccfkuk/h_s_x_r_m_r_b_python | 46fe249b1b71f1245296c8b2dbd6e7c29dadade4 | [
"Unlicense"
] | null | null | null | rmrb/rmrb_daemon/modules/xorg_monitor.py | fjfhccfkuk/h_s_x_r_m_r_b_python | 46fe249b1b71f1245296c8b2dbd6e7c29dadade4 | [
"Unlicense"
] | null | null | null | rmrb/rmrb_daemon/modules/xorg_monitor.py | fjfhccfkuk/h_s_x_r_m_r_b_python | 46fe249b1b71f1245296c8b2dbd6e7c29dadade4 | [
"Unlicense"
] | null | null | null | #!/usr/bin/env python
| 23.186047 | 103 | 0.498495 | #!/usr/bin/env python
def __get_xorg_pid():
pid=-1;
try:
import os;
pid = os.popen('ps aux | grep "/usr/bin/X" | grep -v "grep" | awk \'{print $2}\'').read();
# print "__get_xorg_pid. pid:" + str(pid);
except:
pid=-1
return pid;
def __get_vlc_pid():
pid = -1;
tr... | 1,828 | 0 | 138 |
91571235a6078c3ed7b0317752d9708a8b1d8915 | 709 | py | Python | setup.py | constantinius/fabrant | c91a3594721a707a58e8fe5aa53ffbc5766c33e8 | [
"MIT"
] | null | null | null | setup.py | constantinius/fabrant | c91a3594721a707a58e8fe5aa53ffbc5766c33e8 | [
"MIT"
] | null | null | null | setup.py | constantinius/fabrant | c91a3594721a707a58e8fe5aa53ffbc5766c33e8 | [
"MIT"
] | null | null | null | from setuptools import setup
import fabrant
version = fabrant.__version__
setup(
name='fabrant',
version=version,
description="Easy handling of vagrant hosts within fabric",
long_description=open("README.rst").read(),
author='Fabian Schindler',
author_email='fabian.schindler@eox.at',
lic... | 26.259259 | 63 | 0.643159 | from setuptools import setup
import fabrant
version = fabrant.__version__
setup(
name='fabrant',
version=version,
description="Easy handling of vagrant hosts within fabric",
long_description=open("README.rst").read(),
author='Fabian Schindler',
author_email='fabian.schindler@eox.at',
lic... | 0 | 0 | 0 |
81d5d2a9dcca54b4f49a512570a95264c0ef66f2 | 6,500 | py | Python | lab06.py | ucsb-cs8-m17/lab06_starter_code | 9c91faa04399e22f79c8473823a6ab0756bf097e | [
"MIT"
] | null | null | null | lab06.py | ucsb-cs8-m17/lab06_starter_code | 9c91faa04399e22f79c8473823a6ab0756bf097e | [
"MIT"
] | null | null | null | lab06.py | ucsb-cs8-m17/lab06_starter_code | 9c91faa04399e22f79c8473823a6ab0756bf097e | [
"MIT"
] | null | null | null | # tests for lab06, UCSB, CMPSC 8, Summer 2017
# Instructor: P. Conrad
# Student(s): (insert name here)
# @@@ This next function has an error. Can you fix it?
# @@@ Hint: you might need to use the "and" or "or" keywords of python
# @@@ and modify the if test.
def notStringContainingE(word):
"""
return True when... | 28.888889 | 96 | 0.667385 | # tests for lab06, UCSB, CMPSC 8, Summer 2017
# Instructor: P. Conrad
# Student(s): (insert name here)
# @@@ This next function has an error. Can you fix it?
# @@@ Hint: you might need to use the "and" or "or" keywords of python
# @@@ and modify the if test.
def notStringContainingE(word):
"""
return True when... | 284 | 0 | 185 |
ffa97e68a616803fb3c0b4d35e6fca09a9443725 | 7,791 | py | Python | tests/unit/test_taxonomy.py | ianbakst/tamr-client | ae7a6190a2251d31f973f9d5a7170ac5dc097f97 | [
"Apache-2.0"
] | 9 | 2019-08-13T11:07:06.000Z | 2022-01-14T18:15:13.000Z | tests/unit/test_taxonomy.py | ianbakst/tamr-client | ae7a6190a2251d31f973f9d5a7170ac5dc097f97 | [
"Apache-2.0"
] | 166 | 2019-08-09T18:51:05.000Z | 2021-12-02T15:24:15.000Z | tests/unit/test_taxonomy.py | ianbakst/tamr-client | ae7a6190a2251d31f973f9d5a7170ac5dc097f97 | [
"Apache-2.0"
] | 21 | 2019-08-12T15:37:31.000Z | 2021-06-15T14:06:23.000Z | from functools import partial
import json
from unittest import TestCase
from requests import HTTPError
import responses
from tamr_unify_client import Client
from tamr_unify_client.auth import UsernamePasswordAuth
from tamr_unify_client.categorization.category.collection import CategoryCollection
from tamr_unify_clien... | 34.626667 | 88 | 0.586061 | from functools import partial
import json
from unittest import TestCase
from requests import HTTPError
import responses
from tamr_unify_client import Client
from tamr_unify_client.auth import UsernamePasswordAuth
from tamr_unify_client.categorization.category.collection import CategoryCollection
from tamr_unify_clien... | 4,982 | 2,282 | 23 |
7369f037084a3962ddf0eee3df3221a505a6fe8d | 1,619 | py | Python | Wrapping/Generators/Python/Tests/FlatStructuringElement.py | ltmakela/ITK | 21f48c6d98e21ecece09be16a747221d7094d8a9 | [
"Apache-2.0"
] | 4 | 2015-05-22T03:47:43.000Z | 2016-06-16T20:57:21.000Z | Wrapping/Generators/Python/Tests/FlatStructuringElement.py | GEHC-Surgery/ITK | f5df62749e56c9036e5888cfed904032ba5fdfb7 | [
"Apache-2.0"
] | null | null | null | Wrapping/Generators/Python/Tests/FlatStructuringElement.py | GEHC-Surgery/ITK | f5df62749e56c9036e5888cfed904032ba5fdfb7 | [
"Apache-2.0"
] | 9 | 2016-06-23T16:03:12.000Z | 2022-03-31T09:25:08.000Z | #==========================================================================
#
# Copyright Insight Software Consortium
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http... | 31.134615 | 77 | 0.622607 | #==========================================================================
#
# Copyright Insight Software Consortium
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http... | 0 | 0 | 0 |
e5f027cbb302d153a7c3344375fc208328785c24 | 145 | py | Python | 1071.py | barroslipe/urionlinejudge | a20d8199d9a92b30ea394a6c949967d2fc51aa34 | [
"MIT"
] | null | null | null | 1071.py | barroslipe/urionlinejudge | a20d8199d9a92b30ea394a6c949967d2fc51aa34 | [
"MIT"
] | null | null | null | 1071.py | barroslipe/urionlinejudge | a20d8199d9a92b30ea394a6c949967d2fc51aa34 | [
"MIT"
] | null | null | null | x = int(input())
y = int(input())
if x > y:
x, y = y, x
soma = 0
for i in range(x+1, y, 1):
if i%2 != 0:
soma += i
print(soma) | 12.083333 | 26 | 0.448276 | x = int(input())
y = int(input())
if x > y:
x, y = y, x
soma = 0
for i in range(x+1, y, 1):
if i%2 != 0:
soma += i
print(soma) | 0 | 0 | 0 |
a632fc8a11dc7f1808f06cdcb2bf2ece87cfe09f | 2,554 | py | Python | gethouse/models.py | Alvin-21/patanyumba | 4084d8b25a1685fa3a1ce8a57f782fa01bc794cb | [
"MIT"
] | null | null | null | gethouse/models.py | Alvin-21/patanyumba | 4084d8b25a1685fa3a1ce8a57f782fa01bc794cb | [
"MIT"
] | null | null | null | gethouse/models.py | Alvin-21/patanyumba | 4084d8b25a1685fa3a1ce8a57f782fa01bc794cb | [
"MIT"
] | null | null | null | from django.db import models
from cloudinary.models import CloudinaryField
from django.contrib.auth.models import User
# Create your models here.
| 29.697674 | 89 | 0.667189 | from django.db import models
from cloudinary.models import CloudinaryField
from django.contrib.auth.models import User
# Create your models here.
class Amenities(models.Model):
name = models.CharField(max_length=50)
def __str__(self):
return self.name
class Accomodation(models.Model):
PROPERTY_... | 389 | 1,920 | 92 |
85709feb51b43f2818c30daf6bbb587cb3a6b7ce | 295 | py | Python | file-response/main.py | Nivratti/fastapi | d3f8c750ae15201b50be80d998cfafe6e8d155e9 | [
"Apache-2.0"
] | null | null | null | file-response/main.py | Nivratti/fastapi | d3f8c750ae15201b50be80d998cfafe6e8d155e9 | [
"Apache-2.0"
] | null | null | null | file-response/main.py | Nivratti/fastapi | d3f8c750ae15201b50be80d998cfafe6e8d155e9 | [
"Apache-2.0"
] | null | null | null | from fastapi import FastAPI
from fastapi.responses import FileResponse
app = FastAPI()
@app.get("/") | 24.583333 | 57 | 0.728814 | from fastapi import FastAPI
from fastapi.responses import FileResponse
app = FastAPI()
@app.get("/")
async def main():
# sending it as a attachment
# specify filename to send it as attachment
some_file_path = "dog_bgr.png"
return FileResponse(some_file_path, filename="f.png") | 170 | 0 | 22 |
344ecc1b03332848b6d7b6ff0acbdf7d2641f9c7 | 1,283 | py | Python | backend/tradersplatform/article_comment/serializers.py | ybedirhanpak/bounswe2019group1 | 9572fd307345b3f842c2c2ff4426857086484ed5 | [
"MIT"
] | 10 | 2019-02-14T14:53:49.000Z | 2019-10-23T08:03:39.000Z | backend/tradersplatform/article_comment/serializers.py | ybedirhanpak/bounswe2019group1 | 9572fd307345b3f842c2c2ff4426857086484ed5 | [
"MIT"
] | 364 | 2019-02-14T14:50:12.000Z | 2022-02-10T13:43:09.000Z | backend/tradersplatform/article_comment/serializers.py | bounswe/bounswe2019group1 | 9572fd307345b3f842c2c2ff4426857086484ed5 | [
"MIT"
] | 8 | 2019-05-05T20:04:31.000Z | 2020-12-24T16:44:54.000Z | from rest_framework.serializers import ModelSerializer
from article_comment.models import ArticleComment
from myuser.serializers import TempUserListSerializer
| 24.207547 | 54 | 0.466095 | from rest_framework.serializers import ModelSerializer
from article_comment.models import ArticleComment
from myuser.serializers import TempUserListSerializer
class ArticleCommentCreateSerializer(ModelSerializer):
class Meta:
model = ArticleComment
fields = [
'id',
'text',... | 0 | 1,051 | 69 |
ac43f58b8c8a982a75d5c10502ff59e958530ecc | 6,556 | py | Python | promt_tr/promt_tr.py | ffreemt/promt-tr-free | ff20b0f176f9611fa5a834af5aeaa9ef6ca3a3ee | [
"MIT"
] | null | null | null | promt_tr/promt_tr.py | ffreemt/promt-tr-free | ff20b0f176f9611fa5a834af5aeaa9ef6ca3a3ee | [
"MIT"
] | null | null | null | promt_tr/promt_tr.py | ffreemt/promt-tr-free | ff20b0f176f9611fa5a834af5aeaa9ef6ca3a3ee | [
"MIT"
] | null | null | null | '''
promt translate for free as in beer
'''
from typing import Any, Callable, Dict, Tuple
import sys
import logging
import json
from time import time
from random import randint
import pytest # type: ignore
# import mock
import urllib3
from ratelimit import limits, sleep_and_retry # type: ignore
import requests
fro... | 27.779661 | 133 | 0.596858 | '''
promt translate for free as in beer
'''
from typing import Any, Callable, Dict, Tuple
import sys
import logging
import json
from time import time
from random import randint
import pytest # type: ignore
# import mock
import urllib3
from ratelimit import limits, sleep_and_retry # type: ignore
import requests
fro... | 114 | 0 | 26 |
ec66d8df79c61b3d2ed3ec367d9cc7908a22013a | 878 | py | Python | kite-go/navigation/offline/experiments/quip-issues/relevant.py | kiteco/kiteco-public | 74aaf5b9b0592153b92f7ed982d65e15eea885e3 | [
"BSD-3-Clause"
] | 17 | 2022-01-10T11:01:50.000Z | 2022-03-25T03:21:08.000Z | kite-go/navigation/offline/experiments/quip-issues/relevant.py | kiteco/kiteco-public | 74aaf5b9b0592153b92f7ed982d65e15eea885e3 | [
"BSD-3-Clause"
] | 1 | 2022-01-13T14:28:47.000Z | 2022-01-13T14:28:47.000Z | kite-go/navigation/offline/experiments/quip-issues/relevant.py | kiteco/kiteco-public | 74aaf5b9b0592153b92f7ed982d65e15eea885e3 | [
"BSD-3-Clause"
] | 7 | 2022-01-07T03:58:10.000Z | 2022-03-24T07:38:20.000Z | import argparse
import json
from collections import defaultdict
from typing import Dict, List
if __name__ == "__main__":
main()
| 25.085714 | 74 | 0.65262 | import argparse
import json
from collections import defaultdict
from typing import Dict, List
def main() -> None:
args = parse_args()
with open(args.links, "r") as fp:
links = json.load(fp)
quip_issues = make_quip_issues(links)
with open(args.relevant_issues, "w") as f:
json.dump(qui... | 673 | 0 | 69 |
33190b249bfea8e389858313a9b36fc7c3e017ce | 1,605 | py | Python | ggtools/gg/static_models.py | richannan/GGTOOLS | 7909da988d90de50c82532d97121a3fbcfc0263a | [
"MIT"
] | 22 | 2019-12-16T01:30:29.000Z | 2022-03-01T08:57:07.000Z | ggtools/gg/static_models.py | richannan/GGTOOLS | 7909da988d90de50c82532d97121a3fbcfc0263a | [
"MIT"
] | 3 | 2019-12-23T14:09:30.000Z | 2022-03-29T01:52:53.000Z | ggtools/gg/static_models.py | richannan/GGTOOLS | 7909da988d90de50c82532d97121a3fbcfc0263a | [
"MIT"
] | 13 | 2019-12-19T07:01:19.000Z | 2022-03-14T11:26:36.000Z | from os import path,makedirs
from urllib.request import urlretrieve
def static_download(model):
'''
Download static gravity modle from icgem.gfz-potsdam.de; if the file to be downloaded is already included in the download directory, the download is automatically skipped.
Usage:
static_download('... | 38.214286 | 175 | 0.688474 | from os import path,makedirs
from urllib.request import urlretrieve
def static_download(model):
'''
Download static gravity modle from icgem.gfz-potsdam.de; if the file to be downloaded is already included in the download directory, the download is automatically skipped.
Usage:
static_download('... | 0 | 0 | 0 |
5fd7c795a966a620873f6dbbef744b63cf0773db | 427 | py | Python | projects/migrations/0020_auto_20170131_0419.py | 18F/acquisitions.18f.gov | 7ef7091fd65b4b6797ddeb1c1f56def29522c43b | [
"CC0-1.0"
] | 3 | 2016-11-27T05:02:52.000Z | 2017-01-31T17:36:36.000Z | projects/migrations/0020_auto_20170131_0419.py | 18F/acquisitions.18f.gov | 7ef7091fd65b4b6797ddeb1c1f56def29522c43b | [
"CC0-1.0"
] | 61 | 2016-11-05T00:27:34.000Z | 2017-09-15T23:37:58.000Z | projects/migrations/0020_auto_20170131_0419.py | 18F/acquisitions.18f.gov | 7ef7091fd65b4b6797ddeb1c1f56def29522c43b | [
"CC0-1.0"
] | 2 | 2017-07-14T06:21:26.000Z | 2021-02-14T11:53:05.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.10.4 on 2017-01-31 04:19
from __future__ import unicode_literals
from django.db import migrations
| 20.333333 | 48 | 0.604215 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.4 on 2017-01-31 04:19
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('projects', '0019_auto_20170131_0412'),
]
operations = [
migrations.RenameField(
... | 0 | 256 | 23 |
df77b7f033135104bc001ca98a8adb61a14c3d27 | 31 | py | Python | resources/sound/__init__.py | Keshav-cs/Genetic-Algorithm-on-Super-Mario-Bros | 1a115c6b4ac3345875c8530d8a6ea044c33c403e | [
"MIT"
] | 418 | 2015-01-05T19:31:18.000Z | 2022-03-27T03:05:33.000Z | resources/sound/__init__.py | Keshav-cs/Genetic-Algorithm-on-Super-Mario-Bros | 1a115c6b4ac3345875c8530d8a6ea044c33c403e | [
"MIT"
] | 3 | 2021-04-29T19:58:05.000Z | 2021-05-01T05:15:02.000Z | resources/sound/__init__.py | Keshav-cs/Genetic-Algorithm-on-Super-Mario-Bros | 1a115c6b4ac3345875c8530d8a6ea044c33c403e | [
"MIT"
] | 157 | 2015-01-05T19:06:29.000Z | 2022-01-16T22:55:37.000Z | __author__ = 'justinarmstrong'
| 15.5 | 30 | 0.806452 | __author__ = 'justinarmstrong'
| 0 | 0 | 0 |
76d764d3ec7df55c3465bdeb774b3494cc0fb43a | 321 | py | Python | chapter3/fixed_input_agent.py | yuishihara/probabilistic_robotics_implementations | 91115260cb95697f89b1413d49dd45ebe3014a53 | [
"MIT"
] | null | null | null | chapter3/fixed_input_agent.py | yuishihara/probabilistic_robotics_implementations | 91115260cb95697f89b1413d49dd45ebe3014a53 | [
"MIT"
] | null | null | null | chapter3/fixed_input_agent.py | yuishihara/probabilistic_robotics_implementations | 91115260cb95697f89b1413d49dd45ebe3014a53 | [
"MIT"
] | null | null | null | from agent import Agent
| 24.692308 | 52 | 0.635514 | from agent import Agent
class FixedInputAgent(Agent):
def __init__(self, robot, vel=0.2, omega=0.0):
super(FixedInputAgent, self).__init__(robot)
self._vel = vel
self._omega = omega
def act(self, delta_t):
ut = (self._vel, self._omega)
self._robot.one_step(ut, delta_t)... | 212 | 8 | 76 |
ef57af46c6b2e9ab1c578fab32e7696057a50f5d | 1,011 | py | Python | python/tests/testpickle.py | seisman/mspass | 11bd292a778a2a0d8470734239a7347fe4a1c0a7 | [
"BSD-3-Clause"
] | 1 | 2021-10-18T10:02:13.000Z | 2021-10-18T10:02:13.000Z | python/tests/testpickle.py | seisman/mspass | 11bd292a778a2a0d8470734239a7347fe4a1c0a7 | [
"BSD-3-Clause"
] | null | null | null | python/tests/testpickle.py | seisman/mspass | 11bd292a778a2a0d8470734239a7347fe4a1c0a7 | [
"BSD-3-Clause"
] | null | null | null | import sys
sys.path.append('/home/pavlis/src/mspass/python')
from mspasspy.ccore import CoreSeismogram
d=CoreSeismogram(200)
d.put_double('delta',1.0)
d.put_double('dt',1.0)
d.put('npts',200)
d.ns=200
d.t0=100.0
d.live=True
from mspasspy.ccore import Seismogram
d2=Seismogram(d,'invalid')
import pickle
x=pickle.dumps(d2... | 25.275 | 56 | 0.753709 | import sys
sys.path.append('/home/pavlis/src/mspass/python')
from mspasspy.ccore import CoreSeismogram
d=CoreSeismogram(200)
d.put_double('delta',1.0)
d.put_double('dt',1.0)
d.put('npts',200)
d.ns=200
d.t0=100.0
d.live=True
from mspasspy.ccore import Seismogram
d2=Seismogram(d,'invalid')
import pickle
x=pickle.dumps(d2... | 0 | 0 | 0 |
c8ef1749db9bd82ca80ff83f68f94b743fdbc0d8 | 28,838 | py | Python | pipeline/slices.py | PartumSomnia/bns_ppr_tools | b02bab870bb54171bc0d0cd7e07bfb50e978e7dd | [
"MIT"
] | null | null | null | pipeline/slices.py | PartumSomnia/bns_ppr_tools | b02bab870bb54171bc0d0cd7e07bfb50e978e7dd | [
"MIT"
] | 4 | 2019-12-01T18:42:45.000Z | 2019-12-07T10:59:37.000Z | pipeline/slices.py | PartumSomnia/bns_ppr_tools | b02bab870bb54171bc0d0cd7e07bfb50e978e7dd | [
"MIT"
] | null | null | null | from __future__ import division
#from sys import path
#path.append('modules/')
import os.path
import click
import h5py
from argparse import ArgumentParser
from math import pi, log10
import sys
from scidata.utils import locate
import scidata.carpet.hdf5 as h5
from scidata.carpet.interp import Interpolator
import numpy a... | 42.59675 | 154 | 0.515396 | from __future__ import division
#from sys import path
#path.append('modules/')
import os.path
import click
import h5py
from argparse import ArgumentParser
from math import pi, log10
import sys
from scidata.utils import locate
import scidata.carpet.hdf5 as h5
from scidata.carpet.interp import Interpolator
import numpy a... | 20,890 | 0 | 92 |
e816797defd71414f450b8e5d91abae6b9cf9f15 | 7,532 | py | Python | heartpredictions/LogisticRegression/Trainer.py | Dianevera/heart-prediction | c11e4ce92d501e1a398ee31b44d1552d8c6a29c5 | [
"MIT"
] | null | null | null | heartpredictions/LogisticRegression/Trainer.py | Dianevera/heart-prediction | c11e4ce92d501e1a398ee31b44d1552d8c6a29c5 | [
"MIT"
] | 32 | 2021-09-27T17:32:19.000Z | 2022-01-28T20:06:07.000Z | heartpredictions/LogisticRegression/Trainer.py | Dianevera/heart-prediction | c11e4ce92d501e1a398ee31b44d1552d8c6a29c5 | [
"MIT"
] | 1 | 2021-11-03T13:29:44.000Z | 2021-11-03T13:29:44.000Z | import numpy as np
import tensorflow as tf
import matplotlib.pyplot as plt
from torch import nn
import torch
| 39.642105 | 149 | 0.525358 | import numpy as np
import tensorflow as tf
import matplotlib.pyplot as plt
from torch import nn
import torch
class Trainer:
def __init__(self, model, class_weights, save_directory, loss='dl', lr=0.5, label_name = ""):
"""
Create the Trainer object.
Parameters:
... | 0 | 7,399 | 23 |
cb4d80b54499c7f044d5d3bb7aa86ffb23658862 | 28 | py | Python | exipicrename/__init__.py | unixhex/exipicrename2 | b2a2f5af224c4a2c93f81e48c2622c7522d76489 | [
"MIT"
] | 1 | 2020-02-14T13:41:28.000Z | 2020-02-14T13:41:28.000Z | exipicrename/__init__.py | unixhex/exipicrename2 | b2a2f5af224c4a2c93f81e48c2622c7522d76489 | [
"MIT"
] | 3 | 2021-06-08T19:46:29.000Z | 2022-03-11T23:44:57.000Z | exipicrename/__init__.py | unixhex/exipicrename2 | b2a2f5af224c4a2c93f81e48c2622c7522d76489 | [
"MIT"
] | null | null | null | from .exipicrename import *
| 14 | 27 | 0.785714 | from .exipicrename import *
| 0 | 0 | 0 |
7f8c1278840d863be1b8121c2143ec6ac691623e | 2,392 | py | Python | QuickSort.py | apotato369550/super-simple-sortr | 0b85513a3fc6e426618719577a0d7ccd9385ff77 | [
"MIT"
] | null | null | null | QuickSort.py | apotato369550/super-simple-sortr | 0b85513a3fc6e426618719577a0d7ccd9385ff77 | [
"MIT"
] | null | null | null | QuickSort.py | apotato369550/super-simple-sortr | 0b85513a3fc6e426618719577a0d7ccd9385ff77 | [
"MIT"
] | 1 | 2022-03-09T06:46:14.000Z | 2022-03-09T06:46:14.000Z | from Algorithims import Algorithms
import time
import threading
| 31.064935 | 123 | 0.562291 | from Algorithims import Algorithms
import time
import threading
class QuickSort(Algorithms):
def __init__(self, data, delay):
Algorithms.__init__(self)
self.data = data
self.delay = delay
sorting_thread = threading.Thread(target=self.sort, args=(self.data, 0, len(data) - 1, self.d... | 2,190 | 7 | 130 |
02be5c99a347950f27c83cbd18c1524887f1c17e | 6,488 | py | Python | src/extract_ml_features.py | amansinha09/HSDS | dd7cab75bd79a2cec1b9278215303b5e34e58e89 | [
"MIT"
] | null | null | null | src/extract_ml_features.py | amansinha09/HSDS | dd7cab75bd79a2cec1b9278215303b5e34e58e89 | [
"MIT"
] | null | null | null | src/extract_ml_features.py | amansinha09/HSDS | dd7cab75bd79a2cec1b9278215303b5e34e58e89 | [
"MIT"
] | 1 | 2018-11-17T09:12:31.000Z | 2018-11-17T09:12:31.000Z | #extract_ml_features.py
import emoji, re, os, time, sys
from gensim.models import LdaModel
from gensim.corpora import MmCorpus, Dictionary
from isc_tokenizer import Tokenizer
from isc_tagger import Tagger
from tqdm import tqdm
import vocab_helpers as helper
import utils
import pre_processing as dproc
from nltk import n... | 31.960591 | 143 | 0.719174 | #extract_ml_features.py
import emoji, re, os, time, sys
from gensim.models import LdaModel
from gensim.corpora import MmCorpus, Dictionary
from isc_tokenizer import Tokenizer
from isc_tagger import Tagger
from tqdm import tqdm
import vocab_helpers as helper
import utils
import pre_processing as dproc
from nltk import n... | 5,279 | 0 | 112 |
70d83f669a2aceeb1487977c9a3a11d4d4f1f042 | 244 | py | Python | src/__init__.py | MarcelFox/api-modelo | 1ca862446893d0f0d079cde1b10931b8fd188c57 | [
"CC0-1.0"
] | 1 | 2020-09-29T14:55:08.000Z | 2020-09-29T14:55:08.000Z | src/__init__.py | MarcelFox/api-modelo | 1ca862446893d0f0d079cde1b10931b8fd188c57 | [
"CC0-1.0"
] | null | null | null | src/__init__.py | MarcelFox/api-modelo | 1ca862446893d0f0d079cde1b10931b8fd188c57 | [
"CC0-1.0"
] | null | null | null | from flask import Flask
| 20.333333 | 44 | 0.668033 | from flask import Flask
def create_app():
app = Flask(__name__)
# app.config.from_object('config')
with app.app_context():
from src.app.Router import file_urls
app.register_blueprint(file_urls)
return app
| 196 | 0 | 23 |
4b523a47b862a5ac14fd0e2ce940728a52b0da94 | 535 | py | Python | source/chunk.py | Ryaangu/pyler | 685955088454b01f649a5de95b4b3cf6c6078db3 | [
"MIT"
] | 1 | 2020-11-05T23:36:31.000Z | 2020-11-05T23:36:31.000Z | source/chunk.py | Ryaangu/pyler | 685955088454b01f649a5de95b4b3cf6c6078db3 | [
"MIT"
] | null | null | null | source/chunk.py | Ryaangu/pyler | 685955088454b01f649a5de95b4b3cf6c6078db3 | [
"MIT"
] | 1 | 2020-11-06T12:44:21.000Z | 2020-11-06T12:44:21.000Z | # Chunk
# Write to chunk
# Add constant to chunk | 19.107143 | 43 | 0.583178 | # Chunk
class Chunk():
count = 0
constants_count = 0
code = []
lines = []
columns = []
constants = []
local_variables = []
# Write to chunk
def chunk_write(chunk, byte, line, column):
chunk.code.append(byte)
chunk.lines.append(line)
... | 251 | 168 | 66 |
0a9e811c6d130935e11801209b3068eba9b73f6d | 9,010 | py | Python | elyra/tests/pipeline/test_pipeline_parser.py | el-aasi/elyra | bd06a22c97a5e6083d5a29d88303142e826e2eab | [
"Apache-2.0"
] | 1 | 2022-02-18T14:21:33.000Z | 2022-02-18T14:21:33.000Z | elyra/tests/pipeline/test_pipeline_parser.py | el-aasi/elyra | bd06a22c97a5e6083d5a29d88303142e826e2eab | [
"Apache-2.0"
] | null | null | null | elyra/tests/pipeline/test_pipeline_parser.py | el-aasi/elyra | bd06a22c97a5e6083d5a29d88303142e826e2eab | [
"Apache-2.0"
] | null | null | null | #
# Copyright 2018-2022 Elyra Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | 39.004329 | 112 | 0.723085 | #
# Copyright 2018-2022 Elyra Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | 7,801 | 0 | 413 |
a512f5392dbace5bfc36af9bb0cb5f229444416d | 6,379 | py | Python | csv_to_coco.py | ZHUXUHAN/Tools | 98a0776f460febc69af5523e2c69d7702ee04876 | [
"MIT"
] | 1 | 2019-11-20T12:16:21.000Z | 2019-11-20T12:16:21.000Z | csv_to_coco.py | ZHUXUHAN/Python-Tools | 98a0776f460febc69af5523e2c69d7702ee04876 | [
"MIT"
] | null | null | null | csv_to_coco.py | ZHUXUHAN/Python-Tools | 98a0776f460febc69af5523e2c69d7702ee04876 | [
"MIT"
] | null | null | null | import os
import pandas as pd
from collections import OrderedDict
import cv2
import numpy as np
import json
gt_data_path = "/home/priv-lab1/workspace/zxh/end2/csv/anno_box_train.csv"
hoi_list_path = "/home/priv-lab1/workspace/zxh/end2/origin_lists/hico_list_hoi.txt"
img_path = '/home/priv-lab1/workspace/zxh/My_Databas... | 39.621118 | 113 | 0.551811 | import os
import pandas as pd
from collections import OrderedDict
import cv2
import numpy as np
import json
gt_data_path = "/home/priv-lab1/workspace/zxh/end2/csv/anno_box_train.csv"
hoi_list_path = "/home/priv-lab1/workspace/zxh/end2/origin_lists/hico_list_hoi.txt"
img_path = '/home/priv-lab1/workspace/zxh/My_Databas... | 3,530 | 13 | 102 |
5889664d73c5e5d85739f1d451909c87f007011e | 3,513 | py | Python | dirutility/multiprocess.py | mrstephenneal/dirutility | c51b4c3bd543da8bb69e496d0c3ec8333897042c | [
"MIT"
] | 2 | 2018-07-27T18:34:10.000Z | 2018-10-09T21:40:34.000Z | dirutility/multiprocess.py | mrstephenneal/dirutility | c51b4c3bd543da8bb69e496d0c3ec8333897042c | [
"MIT"
] | 7 | 2018-07-27T17:29:36.000Z | 2018-10-01T13:29:52.000Z | dirutility/multiprocess.py | mrstephenneal/dirutility | c51b4c3bd543da8bb69e496d0c3ec8333897042c | [
"MIT"
] | 1 | 2019-09-26T13:04:04.000Z | 2019-09-26T13:04:04.000Z | from multiprocessing import cpu_count
from multiprocessing.pool import Pool
from tqdm import tqdm
def pool_process(func, iterable, cpus=cpu_count(), return_vals=False, cpu_reduction=0, progress_bar=False):
"""
Multiprocessing helper function for performing looped operation using multiple processors.
:par... | 36.978947 | 107 | 0.63877 | from multiprocessing import cpu_count
from multiprocessing.pool import Pool
from tqdm import tqdm
def pool_process(func, iterable, cpus=cpu_count(), return_vals=False, cpu_reduction=0, progress_bar=False):
"""
Multiprocessing helper function for performing looped operation using multiple processors.
:par... | 0 | 2,167 | 23 |
f5483164f422c3135aabb74cd6db1a01d89851f4 | 617 | py | Python | census_dp/noisy_max.py | candrsn/census-dp | a98b4bc4e03dab3c5d77723806daf387a8cbee8b | [
"MIT"
] | 13 | 2019-08-30T15:05:21.000Z | 2022-03-11T14:17:01.000Z | census_dp/noisy_max.py | chrishwiggins/census-dp | a98b4bc4e03dab3c5d77723806daf387a8cbee8b | [
"MIT"
] | 1 | 2019-08-01T16:20:58.000Z | 2019-08-01T16:20:58.000Z | census_dp/noisy_max.py | chrishwiggins/census-dp | a98b4bc4e03dab3c5d77723806daf387a8cbee8b | [
"MIT"
] | 4 | 2019-09-23T19:29:34.000Z | 2021-02-13T18:09:43.000Z | import numpy as np
from laplace import laplace_mech
def noisy_max(answers: np.ndarray, epsilon: float, sensitivity: float):
""" Implementation of the noisy max mechanism with gap using Laplace noise
Given a set of queries, this mechanism will return the **index**, not the
value, of the query that is prob... | 34.277778 | 78 | 0.721232 | import numpy as np
from laplace import laplace_mech
def noisy_max(answers: np.ndarray, epsilon: float, sensitivity: float):
""" Implementation of the noisy max mechanism with gap using Laplace noise
Given a set of queries, this mechanism will return the **index**, not the
value, of the query that is prob... | 0 | 0 | 0 |
ed609976d006987150b382827dca7d8b313dbdb3 | 782 | py | Python | tests/test_metric_logger.py | zhtianxiao/DLA-Combined-IoUs | 0b9db0e8e2b2927928bd57c6032497d3b87e7905 | [
"BSD-2-Clause"
] | 2 | 2022-01-27T07:08:34.000Z | 2022-03-22T03:14:11.000Z | tests/test_metric_logger.py | zhtianxiao/DLA-Combined-IoUs | 0b9db0e8e2b2927928bd57c6032497d3b87e7905 | [
"BSD-2-Clause"
] | 1 | 2022-02-04T05:38:04.000Z | 2022-02-04T05:38:04.000Z | tests/test_metric_logger.py | zhtianxiao/DLA-Combined-IoUs | 0b9db0e8e2b2927928bd57c6032497d3b87e7905 | [
"BSD-2-Clause"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
import unittest
from dynamic_atss_core.utils.metric_logger import MetricLogger
if __name__ == "__main__":
unittest.main()
| 25.225806 | 71 | 0.63555 | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
import unittest
from dynamic_atss_core.utils.metric_logger import MetricLogger
class TestMetricLogger(unittest.TestCase):
def test_update(self):
meter = MetricLogger()
for i in range(10):
meter.update(metric=float... | 483 | 21 | 76 |
a125abeb0e27dc36ea6ff47b03ac4c93aff2e032 | 2,224 | py | Python | python/run_emulator.py | LCClyde/NyraEmulationSystem | bedd164316abbe833b066e282e0de1c506d45f2b | [
"MIT"
] | null | null | null | python/run_emulator.py | LCClyde/NyraEmulationSystem | bedd164316abbe833b066e282e0de1c506d45f2b | [
"MIT"
] | 1 | 2015-05-12T11:19:58.000Z | 2015-05-12T11:19:58.000Z | python/run_emulator.py | LCClyde/NyraEmulationSystem | bedd164316abbe833b066e282e0de1c506d45f2b | [
"MIT"
] | null | null | null |
import argparse
import pygame
import sys
from nes import Controller
from screen import Screen
from fps import FPS
from tas import TAS
from emulator import Emulator
if __name__ == "__main__":
parser = argparse.ArgumentParser(
description = 'Dumps NES header information')
parser.add_argument('pathna... | 35.301587 | 94 | 0.571043 |
import argparse
import pygame
import sys
from nes import Controller
from screen import Screen
from fps import FPS
from tas import TAS
from emulator import Emulator
if __name__ == "__main__":
parser = argparse.ArgumentParser(
description = 'Dumps NES header information')
parser.add_argument('pathna... | 0 | 0 | 0 |
20454a0fbb1ea04507f12ffef3b7da1960cf9ea3 | 1,317 | py | Python | lambda_cron/cli/command/aws_lambda.py | MediaMath/lambda-cron | 2545e9fdeced7ebeaba2f98d02891cc6db7546e2 | [
"Apache-2.0"
] | 22 | 2017-10-27T11:37:58.000Z | 2021-11-09T09:35:37.000Z | lambda_cron/cli/command/aws_lambda.py | MediaMath/lambda-cron | 2545e9fdeced7ebeaba2f98d02891cc6db7546e2 | [
"Apache-2.0"
] | 1 | 2018-03-21T18:31:01.000Z | 2018-03-21T18:31:01.000Z | lambda_cron/cli/command/aws_lambda.py | MediaMath/lambda-cron | 2545e9fdeced7ebeaba2f98d02891cc6db7546e2 | [
"Apache-2.0"
] | 3 | 2017-10-27T16:49:42.000Z | 2018-11-03T04:14:10.000Z | # Copyright (C) 2016 MediaMath <http://www.mediamath.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | 38.735294 | 145 | 0.675778 | # Copyright (C) 2016 MediaMath <http://www.mediamath.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | 570 | 11 | 77 |
f42c02c0c9b6c0a562b01ec9dc5934ca6fed0f1a | 4,602 | py | Python | geoportal/geoportailv3_geoportal/views/casipo.py | Geoportail-Luxembourg/geoportailv3 | a3797a426e263683cdebe371753e655604789474 | [
"MIT"
] | 17 | 2015-01-14T08:40:22.000Z | 2021-05-08T04:39:50.000Z | geoportal/geoportailv3_geoportal/views/casipo.py | Geoportail-Luxembourg/geoportailv3 | a3797a426e263683cdebe371753e655604789474 | [
"MIT"
] | 1,477 | 2015-01-05T09:58:41.000Z | 2022-03-18T11:07:09.000Z | geoportal/geoportailv3_geoportal/views/casipo.py | Geoportail-Luxembourg/geoportailv3 | a3797a426e263683cdebe371753e655604789474 | [
"MIT"
] | 14 | 2015-07-24T07:33:13.000Z | 2021-03-02T13:51:48.000Z | # -*- coding: UTF-8 -*-
from pyramid.i18n import get_localizer, TranslationStringFactory
from pyramid.view import view_config
from pyramid.response import Response
from c2cgeoportal_commons.models import DBSessions, DBSession
import logging
import owncloud
import shutil
import os
import smtplib
import urllib.request
f... | 37.112903 | 215 | 0.590613 | # -*- coding: UTF-8 -*-
from pyramid.i18n import get_localizer, TranslationStringFactory
from pyramid.view import view_config
from pyramid.response import Response
from c2cgeoportal_commons.models import DBSessions, DBSession
import logging
import owncloud
import shutil
import os
import smtplib
import urllib.request
f... | 3,879 | 207 | 23 |
67ebedd5c27133e804f63aa2724d413856cdf63d | 431 | py | Python | tests/test_url.py | keeranrichardson/python-seo-tool | 0bc9c675be7c6757649abf06bde7d76d3f75fe81 | [
"MIT"
] | 1 | 2022-02-20T17:23:41.000Z | 2022-02-20T17:23:41.000Z | tests/test_url.py | keeranrichardson/python-seo-tool | 0bc9c675be7c6757649abf06bde7d76d3f75fe81 | [
"MIT"
] | null | null | null | tests/test_url.py | keeranrichardson/python-seo-tool | 0bc9c675be7c6757649abf06bde7d76d3f75fe81 | [
"MIT"
] | 1 | 2022-03-05T15:41:33.000Z | 2022-03-05T15:41:33.000Z | from urlScanner import UrlScanner | 28.733333 | 58 | 0.654292 | from urlScanner import UrlScanner
class TestUrl:
def testUrlExistsReturn200(self):
url = UrlScanner('https://keeranrichardson.com')
assert 200 == url.getStatus()
def testUrlNotExistsReturn404(self):
url = UrlScanner('https://keeranrichardson.com/6')
assert 404 == url.getSt... | 297 | -7 | 108 |
cf51cf919c2dc41e8d41e4fd269be21fec666712 | 718 | py | Python | agent/lm_agent/exceptions.py | omnivector-solutions/license-manager | 9eb1e4569d692aef83a2388096e7413bc010be61 | [
"MIT"
] | 2 | 2020-11-15T22:54:39.000Z | 2022-02-15T07:58:55.000Z | agent/lm_agent/exceptions.py | omnivector-solutions/license-manager | 9eb1e4569d692aef83a2388096e7413bc010be61 | [
"MIT"
] | 2 | 2022-02-18T19:36:45.000Z | 2022-03-16T23:07:44.000Z | agent/lm_agent/exceptions.py | omnivector-solutions/license-manager | 9eb1e4569d692aef83a2388096e7413bc010be61 | [
"MIT"
] | null | null | null | """
Custom exceptions for the License Manager Agent.
"""
from buzz import Buzz
class LicenseManagerAuthTokenError(Buzz):
"""Exception for backend connection issues."""
class LicenseManagerBackendConnectionError(Buzz):
"""Exception for backend connection issues."""
class LicenseManagerBackendVersionError(... | 23.933333 | 71 | 0.764624 | """
Custom exceptions for the License Manager Agent.
"""
from buzz import Buzz
class LicenseManagerAuthTokenError(Buzz):
"""Exception for backend connection issues."""
class LicenseManagerBackendConnectionError(Buzz):
"""Exception for backend connection issues."""
class LicenseManagerBackendVersionError(... | 0 | 0 | 0 |
3bfbe1a0536d97cc85cad428177e7d4db99e0f9d | 6,292 | py | Python | raptor/wrapper.py | jialuechen/raptor | bac516a45dfee9d21ac14221a2d9d5bef810cbd0 | [
"MIT"
] | null | null | null | raptor/wrapper.py | jialuechen/raptor | bac516a45dfee9d21ac14221a2d9d5bef810cbd0 | [
"MIT"
] | null | null | null | raptor/wrapper.py | jialuechen/raptor | bac516a45dfee9d21ac14221a2d9d5bef810cbd0 | [
"MIT"
] | null | null | null | import dask as da
from raptor.momentum import (
KAMAIndicator,
ROCIndicator,
RSIIndicator,
StochasticOscillator,
StochRSIIndicator,
)
from raptor.trend import (
MACD,
ADXIndicator,
AroonIndicator,
EMAIndicator,
SMAIndicator,
TRIXIndicat... | 23.303704 | 85 | 0.635092 | import dask as da
from raptor.momentum import (
KAMAIndicator,
ROCIndicator,
RSIIndicator,
StochasticOscillator,
StochRSIIndicator,
)
from raptor.trend import (
MACD,
ADXIndicator,
AroonIndicator,
EMAIndicator,
SMAIndicator,
TRIXIndicat... | 5,634 | 0 | 115 |
322a0b56205aca331aa6de77b96b5abea4e23791 | 486 | py | Python | codes_/0209_Minimum_Size_Subarray_Sum.py | SaitoTsutomu/leetcode | 4656d66ab721a5c7bc59890db9a2331c6823b2bf | [
"MIT"
] | null | null | null | codes_/0209_Minimum_Size_Subarray_Sum.py | SaitoTsutomu/leetcode | 4656d66ab721a5c7bc59890db9a2331c6823b2bf | [
"MIT"
] | null | null | null | codes_/0209_Minimum_Size_Subarray_Sum.py | SaitoTsutomu/leetcode | 4656d66ab721a5c7bc59890db9a2331c6823b2bf | [
"MIT"
] | null | null | null | # %% [209. Minimum Size Subarray Sum](https://leetcode.com/problems/minimum-size-subarray-sum/)
| 37.384615 | 95 | 0.442387 | # %% [209. Minimum Size Subarray Sum](https://leetcode.com/problems/minimum-size-subarray-sum/)
class Solution:
def minSubArrayLen(self, s: int, nums: List[int]) -> int:
p1, p2, sm, mn = 0, -1, 0, -1
while sm >= s or p2 < len(nums) - 1:
if sm < s:
sm += nums[(p2 := p2 + 1... | 348 | -6 | 48 |
a984bcf3192606be4e00f7ce2c78e708bba3758c | 8,858 | py | Python | tools/model_test.py | EmiyaNing/OpenPCDet | 41ff28209cb000b51626a0ed8593b0adbe3dd447 | [
"Apache-2.0"
] | null | null | null | tools/model_test.py | EmiyaNing/OpenPCDet | 41ff28209cb000b51626a0ed8593b0adbe3dd447 | [
"Apache-2.0"
] | null | null | null | tools/model_test.py | EmiyaNing/OpenPCDet | 41ff28209cb000b51626a0ed8593b0adbe3dd447 | [
"Apache-2.0"
] | null | null | null | import argparse
import datetime
import glob
import os
from pathlib import Path
from test import repeat_eval_ckpt
import tqdm
import torch
import torch.distributed as dist
import torch.nn as nn
from tensorboardX import SummaryWriter
from pcdet.config import cfg, cfg_from_list, cfg_from_yaml_file, log_config_to_file
fr... | 38.017167 | 113 | 0.687175 | import argparse
import datetime
import glob
import os
from pathlib import Path
from test import repeat_eval_ckpt
import tqdm
import torch
import torch.distributed as dist
import torch.nn as nn
from tensorboardX import SummaryWriter
from pcdet.config import cfg, cfg_from_list, cfg_from_yaml_file, log_config_to_file
fr... | 8,181 | 0 | 92 |
78f829f3996b17988d65cadef8296a5ba880a14e | 18,198 | py | Python | upstream/test/functional-tests-legacy/PfwTestCase/Types/tSTRING_128.py | TinkerEdgeR-Android/external_parameter-framework | 108db75a59dbea562ac4bcaf8c6cc862c4919af0 | [
"BSD-3-Clause"
] | null | null | null | upstream/test/functional-tests-legacy/PfwTestCase/Types/tSTRING_128.py | TinkerEdgeR-Android/external_parameter-framework | 108db75a59dbea562ac4bcaf8c6cc862c4919af0 | [
"BSD-3-Clause"
] | null | null | null | upstream/test/functional-tests-legacy/PfwTestCase/Types/tSTRING_128.py | TinkerEdgeR-Android/external_parameter-framework | 108db75a59dbea562ac4bcaf8c6cc862c4919af0 | [
"BSD-3-Clause"
] | null | null | null | # -*-coding:utf-8 -*
# Copyright (c) 2011-2015, Intel Corporation
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, thi... | 60.66 | 138 | 0.477415 | # -*-coding:utf-8 -*
# Copyright (c) 2011-2015, Intel Corporation
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, thi... | 176 | 16,253 | 22 |
4a3369cabd1ff491008878d6ff102afb077304b4 | 5,180 | py | Python | predict_gender.py | chenjianxiong/coding_contest_2018 | 69687b73d4448a6cadf6130f462e9bdca2f20bc9 | [
"MIT"
] | null | null | null | predict_gender.py | chenjianxiong/coding_contest_2018 | 69687b73d4448a6cadf6130f462e9bdca2f20bc9 | [
"MIT"
] | null | null | null | predict_gender.py | chenjianxiong/coding_contest_2018 | 69687b73d4448a6cadf6130f462e9bdca2f20bc9 | [
"MIT"
] | null | null | null | import sys
import math
import numpy as np
if __name__ == "__main__":
# We're using 70% of the data for training
TRAIN_SPLIT = 0.8
GENDER_MALE = 1
GENDER_FEMALE = 0
alpha = 0.54
X_train = None
Y_train = None
X_validation = None
Y_validation = None
X_test = None
Y_tes... | 25.771144 | 93 | 0.547876 | import sys
import math
import numpy as np
def features(name):
name = name.lower()
return {
'first-letter': name[0], # First letter
'first2-letters': name[0:2], # First 2 letters
'first3-letters': name[0:3], # First 3 letters
'last-letter': name[-1],
'last2-letters': name... | 3,491 | 0 | 303 |
e4bee58bfdb19c78f18c0a8361e244a7c7f041cb | 898 | py | Python | app/migrations/0002_auto_20210215_2026.py | fossabot/stream_vod_indexer | 58bff60cc4adb1b8e5966134d2e560e59464d196 | [
"MIT"
] | null | null | null | app/migrations/0002_auto_20210215_2026.py | fossabot/stream_vod_indexer | 58bff60cc4adb1b8e5966134d2e560e59464d196 | [
"MIT"
] | null | null | null | app/migrations/0002_auto_20210215_2026.py | fossabot/stream_vod_indexer | 58bff60cc4adb1b8e5966134d2e560e59464d196 | [
"MIT"
] | 1 | 2021-02-18T14:25:39.000Z | 2021-02-18T14:25:39.000Z | # Generated by Django 3.1.6 on 2021-02-15 14:56
from django.db import migrations, models
| 26.411765 | 63 | 0.570156 | # Generated by Django 3.1.6 on 2021-02-15 14:56
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('app', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='gamestorage',
name='game_webpage_link',
... | 0 | 784 | 23 |
15bd8ecc1888b29e46ba8af98328ca4106bb49d4 | 781 | py | Python | src/demo/app.py | GonnaFlyMethod/aiohttp_simple_template | 7bd735c182ac6e45a8fe08485386a6a4465f192a | [
"MIT"
] | null | null | null | src/demo/app.py | GonnaFlyMethod/aiohttp_simple_template | 7bd735c182ac6e45a8fe08485386a6a4465f192a | [
"MIT"
] | null | null | null | src/demo/app.py | GonnaFlyMethod/aiohttp_simple_template | 7bd735c182ac6e45a8fe08485386a6a4465f192a | [
"MIT"
] | null | null | null | import jinja2
import aiohttp_jinja2
import urllib.parse as up
import asyncpg
from aiohttp import web
from .routes import setup_routes
from .config import config_obj as config
| 25.193548 | 76 | 0.641485 | import jinja2
import aiohttp_jinja2
import urllib.parse as up
import asyncpg
from aiohttp import web
from .routes import setup_routes
from .config import config_obj as config
async def on_start(app):
up.uses_netloc.append("postgres")
url = up.urlparse(config['database_url'])
connection = await asyncpg.connect(u... | 555 | 0 | 46 |
00e99788eef7360e5057d06d1769c244b69763ef | 10,949 | py | Python | lolesport_parser/dataclasses/game_details_v5.py | DrArtemi/riot-api | a68bf94061a3c63e511418669097499c3e2c055d | [
"MIT"
] | null | null | null | lolesport_parser/dataclasses/game_details_v5.py | DrArtemi/riot-api | a68bf94061a3c63e511418669097499c3e2c055d | [
"MIT"
] | null | null | null | lolesport_parser/dataclasses/game_details_v5.py | DrArtemi/riot-api | a68bf94061a3c63e511418669097499c3e2c055d | [
"MIT"
] | null | null | null | """
This file has been auto-generated by pydantic.
TODO: Maybe some fields should be renamed or the architecture should be changed a bit
"""
from __future__ import annotations
from typing import List, Optional
from pydantic import BaseModel, Field
| 32.489614 | 96 | 0.728286 | """
This file has been auto-generated by pydantic.
TODO: Maybe some fields should be renamed or the architecture should be changed a bit
"""
from __future__ import annotations
from typing import List, Optional
from pydantic import BaseModel, Field
class Challenges(BaseModel):
field_12AssistStreakCount: Optiona... | 0 | 10,314 | 368 |