hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | 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 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | 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 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | 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 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f77b215b5377846996dff3f3be6a45c243ff99c7 | 1,052 | py | Python | 13.Learning Python Libraries/03.Python Essential Libraries - JM/Pendulum/basicdates.py | ptyadana/python-dojo | 98c7234b84f0afea99a091c7198342d66bbdff5b | [
"MIT"
] | 3 | 2020-06-01T04:17:18.000Z | 2020-12-18T03:05:55.000Z | 13.Learning Python Libraries/03.Python Essential Libraries - JM/Pendulum/basicdates.py | ptyadana/python-dojo | 98c7234b84f0afea99a091c7198342d66bbdff5b | [
"MIT"
] | 1 | 2020-04-25T08:01:59.000Z | 2020-04-25T08:01:59.000Z | 13.Learning Python Libraries/03.Python Essential Libraries - JM/Pendulum/basicdates.py | ptyadana/python-dojo | 98c7234b84f0afea99a091c7198342d66bbdff5b | [
"MIT"
] | 7 | 2020-04-26T10:02:36.000Z | 2021-06-08T05:12:46.000Z | # Python Essential Libraries by Joe Marini course example
# Example file for Pendulum library
from datetime import datetime
import time
import pendulum
# TODO: create a new datetime using pendulum
dt1 = pendulum.datetime(2020, 1, 31)
print(dt1)
print(isinstance(dt1, datetime))
print(dt1.timezone_name)
dt_us = pendulu... | 21.469388 | 62 | 0.761407 | from datetime import datetime
import time
import pendulum
dt1 = pendulum.datetime(2020, 1, 31)
print(dt1)
print(isinstance(dt1, datetime))
print(dt1.timezone_name)
dt_us = pendulum.datetime(2022, 12, 15, tz="America/New_York")
print(dt_us)
print(isinstance(dt_us, datetime))
print(dt_us.timezone_name)
d2 = dt1.in_ti... | true | true |
f77b22015479b12e04da44fc138996924d82c75a | 3,656 | py | Python | dbms airport/myproject/models.py | akkinasrikar/Flask | 4ffe40fba579a4aef6e2f27439691fc7df51bfd5 | [
"MIT"
] | 1 | 2020-09-08T03:22:20.000Z | 2020-09-08T03:22:20.000Z | dbms airport/myproject/models.py | akkinasrikar/Flask | 4ffe40fba579a4aef6e2f27439691fc7df51bfd5 | [
"MIT"
] | null | null | null | dbms airport/myproject/models.py | akkinasrikar/Flask | 4ffe40fba579a4aef6e2f27439691fc7df51bfd5 | [
"MIT"
] | null | null | null | from myproject import db
from myproject import db,login_manager
from werkzeug.security import generate_password_hash,check_password_hash
from flask_login import UserMixin
@login_manager.user_loader
def load_user(user_id):
return User.query.get(user_id)
class User(db.Model,UserMixin):
__tablename__ = 'us... | 28.5625 | 207 | 0.716083 | from myproject import db
from myproject import db,login_manager
from werkzeug.security import generate_password_hash,check_password_hash
from flask_login import UserMixin
@login_manager.user_loader
def load_user(user_id):
return User.query.get(user_id)
class User(db.Model,UserMixin):
__tablename__ = 'us... | true | true |
f77b22dcc1ae68e5794eaaad20465af5c2d32995 | 1,869 | py | Python | ports/esp32/boards/M5CORE2_BOARD/modules/third_party/string.py | ljk53/micropython | 838f3a1ff6e291f9ee287d3c2152097946d4fe8c | [
"MIT"
] | null | null | null | ports/esp32/boards/M5CORE2_BOARD/modules/third_party/string.py | ljk53/micropython | 838f3a1ff6e291f9ee287d3c2152097946d4fe8c | [
"MIT"
] | null | null | null | ports/esp32/boards/M5CORE2_BOARD/modules/third_party/string.py | ljk53/micropython | 838f3a1ff6e291f9ee287d3c2152097946d4fe8c | [
"MIT"
] | null | null | null | # MIT License
#
# Copyright (c) 2019 Johan Brichau
#
# 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 limitation the rights
# to use, copy, modify, merge... | 38.142857 | 80 | 0.699839 |
whitespace = ' \t\n\r\v\f'
ascii_lowercase = 'abcdefghijklmnopqrstuvwxyz'
ascii_uppercase = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
ascii_letters = ascii_lowercase + ascii_uppercase
digits = '0123456789'
hexdigits = digits + 'abcdef' + 'ABCDEF'
octdigits = '01234567'
punctuation = """!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~"""
printable... | true | true |
f77b24b291b757a5c9d73156d31c14e8f1eb6456 | 79 | py | Python | tests/__init__.py | der-gabe/pynonymizer | 3e53bb1f27c2446672f7c2794009354dc8d95ace | [
"MIT"
] | null | null | null | tests/__init__.py | der-gabe/pynonymizer | 3e53bb1f27c2446672f7c2794009354dc8d95ace | [
"MIT"
] | null | null | null | tests/__init__.py | der-gabe/pynonymizer | 3e53bb1f27c2446672f7c2794009354dc8d95ace | [
"MIT"
] | null | null | null | """
This file is required to allow conftest.py to import
pynonymizer stuff
""" | 19.75 | 53 | 0.746835 | true | true | |
f77b25a90f5fd991d9496619548f2b79338a984b | 1,199 | py | Python | tests/infer/test_abstract_infer.py | neerajprad/pyro | 3b5b2c5de208209365bf26f239f12521de68acc4 | [
"MIT"
] | 1 | 2020-08-16T11:27:12.000Z | 2020-08-16T11:27:12.000Z | tests/infer/test_abstract_infer.py | neerajprad/pyro | 3b5b2c5de208209365bf26f239f12521de68acc4 | [
"MIT"
] | null | null | null | tests/infer/test_abstract_infer.py | neerajprad/pyro | 3b5b2c5de208209365bf26f239f12521de68acc4 | [
"MIT"
] | 1 | 2018-12-22T16:15:49.000Z | 2018-12-22T16:15:49.000Z | from __future__ import absolute_import, division, print_function
import torch
import pyro
import pyro.distributions as dist
import pyro.poutine as poutine
from pyro.infer import EmpiricalMarginal, TracePredictive
from pyro.infer.mcmc import MCMC, NUTS
from tests.common import assert_equal
def model(num_trials):
... | 39.966667 | 94 | 0.771476 | from __future__ import absolute_import, division, print_function
import torch
import pyro
import pyro.distributions as dist
import pyro.poutine as poutine
from pyro.infer import EmpiricalMarginal, TracePredictive
from pyro.infer.mcmc import MCMC, NUTS
from tests.common import assert_equal
def model(num_trials):
... | true | true |
f77b27b106879d65d198cbceb5d5d79813daf924 | 16,689 | py | Python | flye/polishing/bubbles.py | RaverJay/Flye | 9c975dd684c3fdcfe9b0f283bb435550fc3883ca | [
"BSD-3-Clause"
] | null | null | null | flye/polishing/bubbles.py | RaverJay/Flye | 9c975dd684c3fdcfe9b0f283bb435550fc3883ca | [
"BSD-3-Clause"
] | null | null | null | flye/polishing/bubbles.py | RaverJay/Flye | 9c975dd684c3fdcfe9b0f283bb435550fc3883ca | [
"BSD-3-Clause"
] | null | null | null | #(c) 2016 by Authors
#This file is a part of ABruijn program.
#Released under the BSD license (see LICENSE file)
"""
Separates alignment into small bubbles for further correction
"""
from __future__ import absolute_import
from __future__ import division
import logging
from bisect import bisect
from flye.six.moves imp... | 35.283298 | 101 | 0.611421 |
from __future__ import absolute_import
from __future__ import division
import logging
from bisect import bisect
from flye.six.moves import range
from collections import defaultdict
import multiprocessing
import traceback
import flye.utils.fasta_parser as fp
import flye.config.py_cfg as cfg
from flye.polishing.align... | true | true |
f77b28140522806ffe34058805d94a2cf2abbe90 | 4,814 | py | Python | app/__init__.py | adithyapaib/whoogle-search | 533a7fccbf262d221bdc959565e1e4bcd72438be | [
"MIT"
] | null | null | null | app/__init__.py | adithyapaib/whoogle-search | 533a7fccbf262d221bdc959565e1e4bcd72438be | [
"MIT"
] | null | null | null | app/__init__.py | adithyapaib/whoogle-search | 533a7fccbf262d221bdc959565e1e4bcd72438be | [
"MIT"
] | null | null | null | from app.filter import clean_query
from app.request import send_tor_signal
from app.utils.session import generate_user_key
from app.utils.bangs import gen_bangs_json
from app.utils.misc import gen_file_hash
from flask import Flask
from flask_session import Session
import json
import logging.config
import os
from stem i... | 37.317829 | 77 | 0.68467 | from app.filter import clean_query
from app.request import send_tor_signal
from app.utils.session import generate_user_key
from app.utils.bangs import gen_bangs_json
from app.utils.misc import gen_file_hash
from flask import Flask
from flask_session import Session
import json
import logging.config
import os
from stem i... | true | true |
f77b2a83b0b7ca5f916c7b9e1afaf9c3feb4c373 | 27,161 | py | Python | chinilla/server/address_manager.py | Chinilla/chinilla-blockchain | 59bebcf94e65b74fbb53ad4929bbd79cb28be619 | [
"Apache-2.0"
] | null | null | null | chinilla/server/address_manager.py | Chinilla/chinilla-blockchain | 59bebcf94e65b74fbb53ad4929bbd79cb28be619 | [
"Apache-2.0"
] | null | null | null | chinilla/server/address_manager.py | Chinilla/chinilla-blockchain | 59bebcf94e65b74fbb53ad4929bbd79cb28be619 | [
"Apache-2.0"
] | null | null | null | import logging
import math
import time
from asyncio import Lock
from random import choice, randrange
from secrets import randbits
from typing import Dict, List, Optional, Set, Tuple
from chinilla.types.peer_info import PeerInfo, TimestampedPeerInfo
from chinilla.util.hash import std_hash
from chinilla.util.ints import... | 41.215478 | 119 | 0.598579 | import logging
import math
import time
from asyncio import Lock
from random import choice, randrange
from secrets import randbits
from typing import Dict, List, Optional, Set, Tuple
from chinilla.types.peer_info import PeerInfo, TimestampedPeerInfo
from chinilla.util.hash import std_hash
from chinilla.util.ints import... | true | true |
f77b2aae46121f58e8962cc3af5ba05a57014b89 | 263 | py | Python | setup.py | jonasvj/protein-generation | ad716f2dba6f6642a6d54571571e6f539cee3644 | [
"MIT"
] | null | null | null | setup.py | jonasvj/protein-generation | ad716f2dba6f6642a6d54571571e6f539cee3644 | [
"MIT"
] | null | null | null | setup.py | jonasvj/protein-generation | ad716f2dba6f6642a6d54571571e6f539cee3644 | [
"MIT"
] | null | null | null | from setuptools import find_packages, setup
setup(
name='src',
packages=find_packages(),
version='0.1.0',
description='Protein generation project for course 02456 Deep Learning at DTU',
author='Jonas Vestergaard Jensen',
license='MIT',
)
| 23.909091 | 83 | 0.703422 | from setuptools import find_packages, setup
setup(
name='src',
packages=find_packages(),
version='0.1.0',
description='Protein generation project for course 02456 Deep Learning at DTU',
author='Jonas Vestergaard Jensen',
license='MIT',
)
| true | true |
f77b2ac915810d15f75403e35a95aeea0888b487 | 484 | py | Python | run.py | vitaliiseuk/Auto-Mac-App-Installer | 59ae503397f60e98482a372545c6a3585cfebf88 | [
"MIT"
] | null | null | null | run.py | vitaliiseuk/Auto-Mac-App-Installer | 59ae503397f60e98482a372545c6a3585cfebf88 | [
"MIT"
] | null | null | null | run.py | vitaliiseuk/Auto-Mac-App-Installer | 59ae503397f60e98482a372545c6a3585cfebf88 | [
"MIT"
] | null | null | null | import commands
import getpass
def main():
paths = dict()
with open('urls.txt') as fp:
for item in fp:
temp = item.split('=')
paths[temp[0]] = temp[1].strip('\n')
user_name = getpass.getuser()
#print user_name
url_check = '/Users/' + user_name + paths['RUN_PATH']
temp1 = paths['RUN_PATH'].replace(... | 17.285714 | 54 | 0.615702 | import commands
import getpass
def main():
paths = dict()
with open('urls.txt') as fp:
for item in fp:
temp = item.split('=')
paths[temp[0]] = temp[1].strip('\n')
user_name = getpass.getuser()
url_check = '/Users/' + user_name + paths['RUN_PATH']
temp1 = paths['RUN_PATH'].replace(' ', '\ ')
url =... | true | true |
f77b2b4aeb29f136ce855a327d8c8298b62941f6 | 934 | py | Python | backend/app/test/sample_data.py | kentayamada-dev/mercari-clone | 37cfa97876ebd4a003c4ca339cb4cdc5e012d502 | [
"MIT"
] | 6 | 2022-01-21T06:17:05.000Z | 2022-03-27T05:45:23.000Z | backend/app/test/sample_data.py | kentayamada-dev/mercari-clone | 37cfa97876ebd4a003c4ca339cb4cdc5e012d502 | [
"MIT"
] | null | null | null | backend/app/test/sample_data.py | kentayamada-dev/mercari-clone | 37cfa97876ebd4a003c4ca339cb4cdc5e012d502 | [
"MIT"
] | 1 | 2022-03-27T05:45:31.000Z | 2022-03-27T05:45:31.000Z | from app.schema.item import ItemCreate
from app.schema.seller import SellerCreate
seller_1_raw_get = {
"name": "name_1",
"email": "email_1@gmail.com",
"image_url": "http://image.com/seller_1.jpg",
}
seller_1_raw = {
**seller_1_raw_get,
"password": "password_1",
}
seller_1_typed = SellerCreate(**s... | 19.87234 | 51 | 0.603854 | from app.schema.item import ItemCreate
from app.schema.seller import SellerCreate
seller_1_raw_get = {
"name": "name_1",
"email": "email_1@gmail.com",
"image_url": "http://image.com/seller_1.jpg",
}
seller_1_raw = {
**seller_1_raw_get,
"password": "password_1",
}
seller_1_typed = SellerCreate(**s... | true | true |
f77b2b54d9758af0ce19eae9260335fe02f5292b | 18,467 | py | Python | rasterization_q10/input_representation/agents.py | j2k0618/PECNet_nuScenes | 9bed2f846ddae11c21b9a4df6487e5c80e9eb01f | [
"MIT"
] | null | null | null | rasterization_q10/input_representation/agents.py | j2k0618/PECNet_nuScenes | 9bed2f846ddae11c21b9a4df6487e5c80e9eb01f | [
"MIT"
] | null | null | null | rasterization_q10/input_representation/agents.py | j2k0618/PECNet_nuScenes | 9bed2f846ddae11c21b9a4df6487e5c80e9eb01f | [
"MIT"
] | null | null | null | # nuScenes dev-kit.
# Code written by Freddy Boulton, 2020.
import colorsys
from typing import Any, Dict, List, Tuple, Callable
import cv2
import numpy as np
from pyquaternion import Quaternion
from nuscenes.prediction import PredictHelper
from nuscenes.prediction.helper import quaternion_yaw
from nuscenes.prediction... | 39.713978 | 114 | 0.620729 | import colorsys
from typing import Any, Dict, List, Tuple, Callable
import cv2
import numpy as np
from pyquaternion import Quaternion
from nuscenes.prediction import PredictHelper
from nuscenes.prediction.helper import quaternion_yaw
from nuscenes.prediction.input_representation.interface import AgentRepresentation
f... | true | true |
f77b2b5c34707017b96e7bfd4b74047568781196 | 2,293 | py | Python | twitoff/twitter.py | lsraei20/twitoff | 0fe36df4b45b6858fd7467f7a6ebdef9926310fd | [
"MIT"
] | null | null | null | twitoff/twitter.py | lsraei20/twitoff | 0fe36df4b45b6858fd7467f7a6ebdef9926310fd | [
"MIT"
] | null | null | null | twitoff/twitter.py | lsraei20/twitoff | 0fe36df4b45b6858fd7467f7a6ebdef9926310fd | [
"MIT"
] | null | null | null | """Retrieve Tweets, embeddings, and persist in the database."""
from os import getenv
import tweepy
import basilica
from .models import DB, User, Tweet
TWITTER_USERS = ['calebhicks', 'elonmusk', 'rrherr', 'SteveMartinToGo',
'alyankovic', 'nasa', 'sadserver', 'jkhowland', 'austen',
'co... | 40.22807 | 87 | 0.619712 | from os import getenv
import tweepy
import basilica
from .models import DB, User, Tweet
TWITTER_USERS = ['calebhicks', 'elonmusk', 'rrherr', 'SteveMartinToGo',
'alyankovic', 'nasa', 'sadserver', 'jkhowland', 'austen',
'common_squirrel', 'KenJennings', 'conanobrien',
'... | true | true |
f77b2bb39847c977ff1d1ef02d43cccc237242dd | 95 | py | Python | aqa/products/apps.py | ksemilla/aqa | 0af1ad330df58524a6aeae966e349e9785eefbf7 | [
"MIT"
] | null | null | null | aqa/products/apps.py | ksemilla/aqa | 0af1ad330df58524a6aeae966e349e9785eefbf7 | [
"MIT"
] | null | null | null | aqa/products/apps.py | ksemilla/aqa | 0af1ad330df58524a6aeae966e349e9785eefbf7 | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class ProductsConfig(AppConfig):
name = 'aqa.products'
| 15.833333 | 33 | 0.757895 | from django.apps import AppConfig
class ProductsConfig(AppConfig):
name = 'aqa.products'
| true | true |
f77b2c16809da420fd8fed4932904925cee2c90f | 4,670 | py | Python | roteamento.py | victorgmlyra/GA_routing | fe229f55620972c36822bc333953069e67e17a59 | [
"MIT"
] | null | null | null | roteamento.py | victorgmlyra/GA_routing | fe229f55620972c36822bc333953069e67e17a59 | [
"MIT"
] | null | null | null | roteamento.py | victorgmlyra/GA_routing | fe229f55620972c36822bc333953069e67e17a59 | [
"MIT"
] | null | null | null | from evo import Evo
import numpy as np
import matplotlib.pyplot as plt
import networkx as nx
from itertools import islice
def k_shortest_paths(G, source, target, k, weight=None):
return list(
islice(nx.shortest_simple_paths(G, source, target, weight=weight), k)
)
def draw_graph_with_subpaths(best, k_... | 31.768707 | 124 | 0.624839 | from evo import Evo
import numpy as np
import matplotlib.pyplot as plt
import networkx as nx
from itertools import islice
def k_shortest_paths(G, source, target, k, weight=None):
return list(
islice(nx.shortest_simple_paths(G, source, target, weight=weight), k)
)
def draw_graph_with_subpaths(best, k_... | true | true |
f77b2c8a5a82e3a295abbbf564dc97e17848269b | 2,243 | py | Python | apis_core/apis_relations/rel_views.py | sviatoplok/apis-core | c23718af2a51598e32684b9b954b594ceef1f0f7 | [
"MIT"
] | 1 | 2019-09-02T09:14:06.000Z | 2019-09-02T09:14:06.000Z | apis_core/apis_relations/rel_views.py | sviatoplok/apis-core | c23718af2a51598e32684b9b954b594ceef1f0f7 | [
"MIT"
] | null | null | null | apis_core/apis_relations/rel_views.py | sviatoplok/apis-core | c23718af2a51598e32684b9b954b594ceef1f0f7 | [
"MIT"
] | null | null | null | from django.conf import settings
from django.views.generic.detail import DetailView
from django.contrib.contenttypes.models import ContentType
from django_tables2 import RequestConfig
from apis_core.apis_entities.views import GenericListViewNew
from . forms2 import GenericRelationForm
from . tables import get_generic... | 35.046875 | 75 | 0.696835 | from django.conf import settings
from django.views.generic.detail import DetailView
from django.contrib.contenttypes.models import ContentType
from django_tables2 import RequestConfig
from apis_core.apis_entities.views import GenericListViewNew
from . forms2 import GenericRelationForm
from . tables import get_generic... | true | true |
f77b2d0cbf3a968abdb45b3f32fb12f73015ec8c | 94,962 | py | Python | src/sage/categories/modules_with_basis.py | tashakim/sage | 467fbc70a08b552b3de33d9065204ee9cbfb02c7 | [
"BSL-1.0"
] | 4 | 2020-07-17T04:49:44.000Z | 2020-07-29T06:33:51.000Z | src/sage/categories/modules_with_basis.py | Ivo-Maffei/sage | 467fbc70a08b552b3de33d9065204ee9cbfb02c7 | [
"BSL-1.0"
] | null | null | null | src/sage/categories/modules_with_basis.py | Ivo-Maffei/sage | 467fbc70a08b552b3de33d9065204ee9cbfb02c7 | [
"BSL-1.0"
] | null | null | null | r"""
Modules With Basis
AUTHORS:
- Nicolas M. Thiery (2008-2014): initial revision, axiomatization
- Jason Bandlow and Florent Hivert (2010): Triangular Morphisms
- Christian Stump (2010): :trac:`9648` module_morphism's to a wider class
of codomains
"""
#*************************************************************... | 38.649573 | 152 | 0.492123 | from __future__ import absolute_import
from sage.misc.lazy_import import LazyImport, lazy_import
from sage.misc.lazy_attribute import lazy_attribute
from sage.misc.cachefunc import cached_method
from sage.misc.abstract_method import abstract_method
from sage.categories.homsets import HomsetsCategory
from sage.categori... | true | true |
f77b2ffca41c1f0b50b2bff2525ef79f7b3074a8 | 2,645 | py | Python | procrastinate/connector.py | tomdottom/procrastinate | 861553064218d33310b7fbdd198f0d43227de434 | [
"MIT"
] | null | null | null | procrastinate/connector.py | tomdottom/procrastinate | 861553064218d33310b7fbdd198f0d43227de434 | [
"MIT"
] | 1 | 2021-09-16T09:42:02.000Z | 2021-09-16T09:42:02.000Z | procrastinate/connector.py | mecampbellsoup/procrastinate | f07d7535e449d3efa92bcc39ad6d6fad5784b548 | [
"MIT"
] | null | null | null | import asyncio
from typing import Any, Callable, Dict, Iterable, List, Optional
from procrastinate import exceptions, utils
QUEUEING_LOCK_CONSTRAINT = "procrastinate_jobs_queueing_lock_idx"
Pool = Any # The connection pool can be any pool object compatible with the database.
class BaseConnector:
json_dumps: ... | 30.402299 | 86 | 0.686578 | import asyncio
from typing import Any, Callable, Dict, Iterable, List, Optional
from procrastinate import exceptions, utils
QUEUEING_LOCK_CONSTRAINT = "procrastinate_jobs_queueing_lock_idx"
Pool = Any
class BaseConnector:
json_dumps: Optional[Callable] = None
json_loads: Optional[Callable] = None
de... | true | true |
f77b3017e7997e90a32cc1ca486038f7dc8ed8f1 | 7,488 | py | Python | pySSG.tab/Family Parameters.Panel/Family Parameters.stack/TableToParameters.pushbutton/script.py | kbruxvoort/SSG.extension | ea0e0472e1c3940a63cab8c013228cba6425595a | [
"MIT"
] | 2 | 2021-09-29T10:49:16.000Z | 2022-02-18T04:05:18.000Z | pySSG.tab/Family Parameters.Panel/Family Parameters.stack/TableToParameters.pushbutton/script.py | kbruxvoort/SSG.extension | ea0e0472e1c3940a63cab8c013228cba6425595a | [
"MIT"
] | 1 | 2022-02-28T14:01:43.000Z | 2022-02-28T14:01:43.000Z | pySSG.tab/Family Parameters.Panel/Family Parameters.stack/TableToParameters.pushbutton/script.py | kbruxvoort/SSG.extension | ea0e0472e1c3940a63cab8c013228cba6425595a | [
"MIT"
] | null | null | null | from ast import literal_eval
from csv import DictReader, QUOTE_NONE
from pyrevit import revit, DB, script, forms
from operator import itemgetter
from rpw.ui.forms import (FlexForm, Label, ComboBox, TextBox, TextBox,
Separator, Button, CheckBox, Alert)
output = script.get_output()
data_types ... | 38.597938 | 112 | 0.550347 | from ast import literal_eval
from csv import DictReader, QUOTE_NONE
from pyrevit import revit, DB, script, forms
from operator import itemgetter
from rpw.ui.forms import (FlexForm, Label, ComboBox, TextBox, TextBox,
Separator, Button, CheckBox, Alert)
output = script.get_output()
data_types ... | true | true |
f77b3033c76fe0e2a901780bbfe0614614418422 | 15,712 | py | Python | I2C/pygameJoystick.py | Hannimal/raspicar | bb8d740801393586c9bb55f5adc2e79418e7448a | [
"Unlicense"
] | 1 | 2021-07-21T00:37:42.000Z | 2021-07-21T00:37:42.000Z | I2C/pygameJoystick.py | Hannimal/raspicar | bb8d740801393586c9bb55f5adc2e79418e7448a | [
"Unlicense"
] | null | null | null | I2C/pygameJoystick.py | Hannimal/raspicar | bb8d740801393586c9bb55f5adc2e79418e7448a | [
"Unlicense"
] | 1 | 2019-12-01T21:25:25.000Z | 2019-12-01T21:25:25.000Z | import time
import pygame
from pygame.locals import *
# The individual event object that is returned
# This serves as a proxy to pygame's event object
# and the key field is one of the strings in the button list listed below
# in the InputManager's constructor
# This comment is actually longer than the class defin... | 41.238845 | 98 | 0.575802 | import time
import pygame
from pygame.locals import *
# and the key field is one of the strings in the button list listed below
# in the InputManager's constructor
class InputEvent:
def __init__(self, key, down):
self.key = key
self.down = down
self.up = not down
class InputManager:
... | true | true |
f77b311360850e17913f56cace452e08850645c2 | 735 | py | Python | ABC112/C.py | shimomura314/AtcoderCodes | db1d62a7715f5f1b3c40eceff8d34f0f34839f41 | [
"MIT"
] | null | null | null | ABC112/C.py | shimomura314/AtcoderCodes | db1d62a7715f5f1b3c40eceff8d34f0f34839f41 | [
"MIT"
] | null | null | null | ABC112/C.py | shimomura314/AtcoderCodes | db1d62a7715f5f1b3c40eceff8d34f0f34839f41 | [
"MIT"
] | null | null | null | def main():
n = int(input())
xyh=[]
for _ in range(n):
x,y,h = map(int,input().split())
xyh.append([x,y,h])
xyh.sort(key=lambda x: x[2], reverse=True)
for xc in range(101):
for yc in range(101):
x = xyh[0][0]
y = xyh[0][1]
h = xyh[0][2]
... | 26.25 | 46 | 0.34966 | def main():
n = int(input())
xyh=[]
for _ in range(n):
x,y,h = map(int,input().split())
xyh.append([x,y,h])
xyh.sort(key=lambda x: x[2], reverse=True)
for xc in range(101):
for yc in range(101):
x = xyh[0][0]
y = xyh[0][1]
h = xyh[0][2]
... | true | true |
f77b3127d5a947cc99c2ee304a07ac09d0238a57 | 744 | py | Python | torch_geometric/transforms/remove_isolated_nodes.py | LingxiaoShawn/pytorch_geometric | 50b7bfc4a59b5b6f7ec547ff862985f3b2e22798 | [
"MIT"
] | 2 | 2020-08-06T16:14:15.000Z | 2021-11-08T07:33:21.000Z | torch_geometric/transforms/remove_isolated_nodes.py | LingxiaoShawn/pytorch_geometric | 50b7bfc4a59b5b6f7ec547ff862985f3b2e22798 | [
"MIT"
] | 1 | 2021-06-05T10:32:22.000Z | 2021-06-05T10:32:22.000Z | torch_geometric/transforms/remove_isolated_nodes.py | LingxiaoShawn/pytorch_geometric | 50b7bfc4a59b5b6f7ec547ff862985f3b2e22798 | [
"MIT"
] | null | null | null | import re
import torch
from torch_geometric.transforms import BaseTransform
from torch_geometric.utils import remove_isolated_nodes
class RemoveIsolatedNodes(BaseTransform):
r"""Removes isolated nodes from the graph."""
def __call__(self, data):
num_nodes = data.num_nodes
out = remove_isolat... | 28.615385 | 79 | 0.649194 | import re
import torch
from torch_geometric.transforms import BaseTransform
from torch_geometric.utils import remove_isolated_nodes
class RemoveIsolatedNodes(BaseTransform):
def __call__(self, data):
num_nodes = data.num_nodes
out = remove_isolated_nodes(data.edge_index, data.edge_attr, num_node... | true | true |
f77b32f2a3beca68ec2f8a2d284f2032af51f95a | 1,268 | py | Python | Python/merge_sort.py | enrinal/-HACKTOBERFEST2K20 | e876a815f17d29c9b025ae69965e0a9643edf2fd | [
"Apache-2.0"
] | null | null | null | Python/merge_sort.py | enrinal/-HACKTOBERFEST2K20 | e876a815f17d29c9b025ae69965e0a9643edf2fd | [
"Apache-2.0"
] | null | null | null | Python/merge_sort.py | enrinal/-HACKTOBERFEST2K20 | e876a815f17d29c9b025ae69965e0a9643edf2fd | [
"Apache-2.0"
] | null | null | null | # Python program for implementation of MergeSort
def mergeSort(arr):
if len(arr) >1:
mid = len(arr)//2 # Finding the mid of the array
L = arr[:mid] # Dividing the array elements
R = arr[mid:] # into 2 halves
mergeSort(L) # Sorting the first half
mergeSort(R) # Sort... | 26.416667 | 57 | 0.435331 | def mergeSort(arr):
if len(arr) >1:
mid = len(arr)//2 L = arr[:mid] R = arr[mid:]
mergeSort(L) mergeSort(R)
i = j = k = 0
while i < len(L) and j < len(R):
if L[i] < R[j]:
arr[k] = L[i]
i... | true | true |
f77b333deabdb2c1cb1d49f02defd8b2e8d58dee | 1,067 | py | Python | app/api/vrf/views.py | briantsaunders/flask-example-app | 1378d0c6985af91f2cc89c86f5466381b7b19a86 | [
"MIT"
] | 1 | 2021-04-08T07:54:19.000Z | 2021-04-08T07:54:19.000Z | app/api/vrf/views.py | briantsaunders/flask-vrfs-api | 1378d0c6985af91f2cc89c86f5466381b7b19a86 | [
"MIT"
] | null | null | null | app/api/vrf/views.py | briantsaunders/flask-vrfs-api | 1378d0c6985af91f2cc89c86f5466381b7b19a86 | [
"MIT"
] | null | null | null | # import third party libs
from flask_apispec.annotations import marshal_with, doc, use_kwargs
from flask_apispec.views import MethodResource
# import app libs
from app.api import api
from app.api.errors import error_response
from app.core.vrf_operations import VrfOperations
from app.schemas.response.vrf import VrfResp... | 30.485714 | 70 | 0.716963 | from flask_apispec.annotations import marshal_with, doc, use_kwargs
from flask_apispec.views import MethodResource
from app.api import api
from app.api.errors import error_response
from app.core.vrf_operations import VrfOperations
from app.schemas.response.vrf import VrfResponseSchema
from app.schemas.query.vrfs impor... | true | true |
f77b338a7c579ce2518c0bda3a30761c20e57c60 | 17,658 | py | Python | web_app.py | jstanley2/raspbeery-pi | 7e765d435ebcc95cc2612f589e4df51047dcaa98 | [
"MIT"
] | null | null | null | web_app.py | jstanley2/raspbeery-pi | 7e765d435ebcc95cc2612f589e4df51047dcaa98 | [
"MIT"
] | null | null | null | web_app.py | jstanley2/raspbeery-pi | 7e765d435ebcc95cc2612f589e4df51047dcaa98 | [
"MIT"
] | null | null | null | #!/usr/bin/python
from apscheduler.schedulers.background import BackgroundScheduler
from datetime import datetime, timedelta
import ConfigParser
import ibmiotf.application
import json
import os
import requests
import time
class MonitorApplication:
DEFAULT_TAP_SIZE = 5.0
DEFAULT_ORDER_AMOUNT = 31.0
DEFAU... | 38.056034 | 167 | 0.608393 |
from apscheduler.schedulers.background import BackgroundScheduler
from datetime import datetime, timedelta
import ConfigParser
import ibmiotf.application
import json
import os
import requests
import time
class MonitorApplication:
DEFAULT_TAP_SIZE = 5.0
DEFAULT_ORDER_AMOUNT = 31.0
DEFAULT_MAX_STORAGE = 3... | true | true |
f77b3412917fca3764ac785c5cffcef9914a5aaf | 16,608 | py | Python | tests/operators/vector/test_prelu_grad_001.py | laekov/akg | 5316b8cb2340bbf71bdc724dc9d81513a67b3104 | [
"Apache-2.0"
] | 1 | 2020-08-31T02:43:43.000Z | 2020-08-31T02:43:43.000Z | tests/operators/vector/test_prelu_grad_001.py | laekov/akg | 5316b8cb2340bbf71bdc724dc9d81513a67b3104 | [
"Apache-2.0"
] | null | null | null | tests/operators/vector/test_prelu_grad_001.py | laekov/akg | 5316b8cb2340bbf71bdc724dc9d81513a67b3104 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 Huawei Technologies Co., Ltd
#
# 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... | 74.810811 | 129 | 0.501024 |
import os
from base import TestBase
import pytest
from test_run.prelu_grad_run import prelu_grad_run
class TestCase(TestBase):
def setup(self):
case_name = "test_prelu_grad_001"
case_path = os.getcwd()
self.params_init(case_name, case_path)
self.caseresult = True
... | true | true |
f77b342434185eb4df947a827e59ed188d2a9fe8 | 1,432 | py | Python | users/tests.py | bolanebyla/Django-template | 2700f044eff0c5ccab91b1ffc59fae50e77bea87 | [
"Unlicense"
] | 2 | 2021-11-03T10:32:44.000Z | 2022-03-24T00:41:02.000Z | users/tests.py | bolanebyla/Django-template | 2700f044eff0c5ccab91b1ffc59fae50e77bea87 | [
"Unlicense"
] | null | null | null | users/tests.py | bolanebyla/Django-template | 2700f044eff0c5ccab91b1ffc59fae50e77bea87 | [
"Unlicense"
] | null | null | null | from django.test import TestCase
from django.contrib.auth import get_user_model, authenticate
class UsersManagersTests(TestCase):
def test_create_user(self):
User = get_user_model()
user = User.objects.create_user(username='normal_user', password='foo')
self.assertEqual(user.username, 'nor... | 39.777778 | 89 | 0.694134 | from django.test import TestCase
from django.contrib.auth import get_user_model, authenticate
class UsersManagersTests(TestCase):
def test_create_user(self):
User = get_user_model()
user = User.objects.create_user(username='normal_user', password='foo')
self.assertEqual(user.username, 'nor... | true | true |
f77b3483fcd39665ba7eccff146759853e0f46d1 | 1,420 | py | Python | fixture/session.py | MishaM1/python_training | 151262bb41dce1edcbf5e572b2800086552435fa | [
"Apache-2.0"
] | null | null | null | fixture/session.py | MishaM1/python_training | 151262bb41dce1edcbf5e572b2800086552435fa | [
"Apache-2.0"
] | null | null | null | fixture/session.py | MishaM1/python_training | 151262bb41dce1edcbf5e572b2800086552435fa | [
"Apache-2.0"
] | null | null | null | class SessionHelper:
def __init__(self, app):
self.app = app
def login(self, username="admin", password="secret"):
wd = self.app.wd
self.app.open_home_page()
wd.find_element_by_name("user").click()
wd.find_element_by_name("user").clear()
wd.find_element_by_name(... | 31.555556 | 73 | 0.608451 | class SessionHelper:
def __init__(self, app):
self.app = app
def login(self, username="admin", password="secret"):
wd = self.app.wd
self.app.open_home_page()
wd.find_element_by_name("user").click()
wd.find_element_by_name("user").clear()
wd.find_element_by_name(... | true | true |
f77b35e46b3f39b2e8631a7455970f5caa0c6174 | 22,072 | py | Python | sdk/python/pulumi_google_native/apigateway/v1beta/gateway_iam_policy.py | AaronFriel/pulumi-google-native | 75d1cda425e33d4610348972cd70bddf35f1770d | [
"Apache-2.0"
] | 44 | 2021-04-18T23:00:48.000Z | 2022-02-14T17:43:15.000Z | sdk/python/pulumi_google_native/apigateway/v1beta/gateway_iam_policy.py | AaronFriel/pulumi-google-native | 75d1cda425e33d4610348972cd70bddf35f1770d | [
"Apache-2.0"
] | 354 | 2021-04-16T16:48:39.000Z | 2022-03-31T17:16:39.000Z | sdk/python/pulumi_google_native/apigateway/v1beta/gateway_iam_policy.py | AaronFriel/pulumi-google-native | 75d1cda425e33d4610348972cd70bddf35f1770d | [
"Apache-2.0"
] | 8 | 2021-04-24T17:46:51.000Z | 2022-01-05T10:40:21.000Z | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
fro... | 78.269504 | 1,118 | 0.706642 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
from . import outputs
from ._enums import *
from ._inputs import *
__all__ = ['GatewayIamPolicyArgs', 'GatewayIamPolicy']
@pulumi.input_type
class GatewayIamPolicyArgs:
... | true | true |
f77b36780ad67000345f333904a87b40e389bf1c | 1,746 | py | Python | pyof/v0x04/symmetric/experimenter.py | smythtech/python-openflow-legacy | f4ddb06ac8c98f074c04f027df4b52542e41c123 | [
"MIT"
] | null | null | null | pyof/v0x04/symmetric/experimenter.py | smythtech/python-openflow-legacy | f4ddb06ac8c98f074c04f027df4b52542e41c123 | [
"MIT"
] | null | null | null | pyof/v0x04/symmetric/experimenter.py | smythtech/python-openflow-legacy | f4ddb06ac8c98f074c04f027df4b52542e41c123 | [
"MIT"
] | null | null | null | """Defines Experimenter message."""
# System imports
# Third-party imports
from pyof.foundation.base import GenericMessage
from pyof.foundation.basic_types import UBInt32
from pyof.v0x04.common.header import Header, Type
__all__ = ('ExperimenterHeader',)
# Classes
class ExperimenterHeader(GenericMessage):
""... | 34.235294 | 78 | 0.709049 |
from pyof.foundation.base import GenericMessage
from pyof.foundation.basic_types import UBInt32
from pyof.v0x04.common.header import Header, Type
__all__ = ('ExperimenterHeader',)
class ExperimenterHeader(GenericMessage):
header = Header(message_type=Type.OFPT_EXPERIMENTER)
experimenter = UBInt32()
... | true | true |
f77b3962da61999a148dd0db56d974dc08a4e303 | 1,730 | py | Python | models/Loyalty.py | borgej/BrexBot | 2413bd4ec978ed40b8e02b1452dcfac9451ee2c5 | [
"Apache-2.0"
] | null | null | null | models/Loyalty.py | borgej/BrexBot | 2413bd4ec978ed40b8e02b1452dcfac9451ee2c5 | [
"Apache-2.0"
] | null | null | null | models/Loyalty.py | borgej/BrexBot | 2413bd4ec978ed40b8e02b1452dcfac9451ee2c5 | [
"Apache-2.0"
] | null | null | null | __author__ = "Børge Jakobsen, Thomas Donegan"
__copyright__ = "Copyright 2019, Brexit boy and SaLmon king"
__credits__ = ["Børge Jakobsen, Thomas Donegan"]
__license__ = "Apache License"
__version__ = "2.0"
__maintainer__ = "Børge Jakobsen, Thomas Donegan"
__status__ = "Development"
from Db import Db
from ModelDbFunct... | 31.454545 | 86 | 0.619075 | __author__ = "Børge Jakobsen, Thomas Donegan"
__copyright__ = "Copyright 2019, Brexit boy and SaLmon king"
__credits__ = ["Børge Jakobsen, Thomas Donegan"]
__license__ = "Apache License"
__version__ = "2.0"
__maintainer__ = "Børge Jakobsen, Thomas Donegan"
__status__ = "Development"
from Db import Db
from ModelDbFunct... | true | true |
f77b39dfc3d8148f18a7ad69bcfd44c4a699e1a1 | 1,509 | py | Python | Matcher/Feature_Matching.py | ezw21/Geospatial_exw | b128cbbdf6fff929e478d46baadc2259e0be1c25 | [
"MIT"
] | null | null | null | Matcher/Feature_Matching.py | ezw21/Geospatial_exw | b128cbbdf6fff929e478d46baadc2259e0be1c25 | [
"MIT"
] | null | null | null | Matcher/Feature_Matching.py | ezw21/Geospatial_exw | b128cbbdf6fff929e478d46baadc2259e0be1c25 | [
"MIT"
] | null | null | null | #__author__ = "Edward Wong"
#__copyright__ = "Copyright 2021, The X Project"
#__credits__ = ["Edward Wong"]
#__license__ = "MIT"
#__version__ = "1.0.1"
#__maintainer__ = "Edward Wong"
#__email__ = "edwsin65@gmail.com"
import numpy as np
import cv2 as cv
import matplotlib.pyplot as plt
img1 = cv.imread(
"differen... | 27.944444 | 76 | 0.724321 |
import numpy as np
import cv2 as cv
import matplotlib.pyplot as plt
img1 = cv.imread(
"differencer/17APR08224828-M3DS-013930604400_01_P002-BROWSE.jpg",
cv.IMREAD_GRAYSCALE,
) img2 = cv.imread(
"differencer/17APR07214525-M3DS-013930604400_01_P003-BROWSE.jpg",
cv.IMREAD_GRAYSCALE,
)
sift = cv.SIFT_c... | true | true |
f77b3b589f06c82d4b269ac8f402e8d38ea1baca | 817 | py | Python | setup.py | ximet/macos-releases | cbf4a1fd16d674a587788e56e0418c72c9193597 | [
"MIT"
] | null | null | null | setup.py | ximet/macos-releases | cbf4a1fd16d674a587788e56e0418c72c9193597 | [
"MIT"
] | null | null | null | setup.py | ximet/macos-releases | cbf4a1fd16d674a587788e56e0418c72c9193597 | [
"MIT"
] | null | null | null | from distutils.core import setup
setup(
name = 'macos-releases',
version = '1.0',
license='MIT',
description = 'Get the name and version of a macOS releases',
author = 'XIMet',
author_email = 'dq.ximet@gmail.com',
url = 'https://github.com/ximet/macos-releases',
download_url = 'https://github.com/ximet/... | 35.521739 | 79 | 0.651163 | from distutils.core import setup
setup(
name = 'macos-releases',
version = '1.0',
license='MIT',
description = 'Get the name and version of a macOS releases',
author = 'XIMet',
author_email = 'dq.ximet@gmail.com',
url = 'https://github.com/ximet/macos-releases',
download_url = 'https://github.com/ximet/... | true | true |
f77b3bd9764aa6d91d114e1fb7aad2f334602e02 | 302 | py | Python | 427A Police Recruits.py | YasirAhmad-EccentriX/CodeForces | d004b4d1b52a360ac6c06870e0a237345771e32c | [
"MIT"
] | 1 | 2021-01-29T16:30:09.000Z | 2021-01-29T16:30:09.000Z | 427A Police Recruits.py | YasirAhmad-EccentriX/CodeForces | d004b4d1b52a360ac6c06870e0a237345771e32c | [
"MIT"
] | null | null | null | 427A Police Recruits.py | YasirAhmad-EccentriX/CodeForces | d004b4d1b52a360ac6c06870e0a237345771e32c | [
"MIT"
] | null | null | null | n=int(input())
e=[int(i) for i in input().split()]
ap=0 #Available Police
uc=0 #Unchecked Case
for i in e:
if i>0:
ap+=i
else:
x= ap+i #since i is negative ap+i=ap-|i|
if x>0:
ap=x
else:
ap=0
uc+=(-x)
print(uc)
| 18.875 | 49 | 0.437086 | n=int(input())
e=[int(i) for i in input().split()]
ap=0 uc=0 for i in e:
if i>0:
ap+=i
else:
x= ap+i if x>0:
ap=x
else:
ap=0
uc+=(-x)
print(uc)
| true | true |
f77b3c218ea3667e5d859a66ffd84cc958776e64 | 9,931 | py | Python | algorithm.py | qiumuyang/NJU-DIP2021 | dda047ffc8752cfbb3a0d618c38480b772eaaa22 | [
"MIT"
] | null | null | null | algorithm.py | qiumuyang/NJU-DIP2021 | dda047ffc8752cfbb3a0d618c38480b772eaaa22 | [
"MIT"
] | null | null | null | algorithm.py | qiumuyang/NJU-DIP2021 | dda047ffc8752cfbb3a0d618c38480b772eaaa22 | [
"MIT"
] | null | null | null | from typing import List, Callable
from functools import wraps
import numpy as np
from numpy import ndarray
from numpy.fft import fft2, fftshift, ifft2, ifftshift
def split_channel(func: Callable[[ndarray], ndarray]):
""" Split channels of the input image.
Assume the decorated function only accept gray-scale ... | 33.664407 | 115 | 0.545162 | from typing import List, Callable
from functools import wraps
import numpy as np
from numpy import ndarray
from numpy.fft import fft2, fftshift, ifft2, ifftshift
def split_channel(func: Callable[[ndarray], ndarray]):
@wraps(func)
def wrapper(*args):
img: ndarray = args[0]
if img.ndim == 2: ... | true | true |
f77b3cb56ecec2941019bc98135a34273e5e55ab | 3,622 | py | Python | vk_bot.py | kvrasuli/quiz_bot | ccbf42066eca7e47e6d2e694fab746c862e5e840 | [
"MIT"
] | null | null | null | vk_bot.py | kvrasuli/quiz_bot | ccbf42066eca7e47e6d2e694fab746c862e5e840 | [
"MIT"
] | null | null | null | vk_bot.py | kvrasuli/quiz_bot | ccbf42066eca7e47e6d2e694fab746c862e5e840 | [
"MIT"
] | null | null | null | import vk_api
from vk_api.longpoll import VkLongPoll, VkEventType
from vk_api.keyboard import VkKeyboard, VkKeyboardColor
from vk_api.utils import get_random_id
from dotenv import load_dotenv
from unpacker import unpack_questions
import os
import random
import redis
import logging
logger = logging.getLogger(__file__)
... | 34.495238 | 88 | 0.68222 | import vk_api
from vk_api.longpoll import VkLongPoll, VkEventType
from vk_api.keyboard import VkKeyboard, VkKeyboardColor
from vk_api.utils import get_random_id
from dotenv import load_dotenv
from unpacker import unpack_questions
import os
import random
import redis
import logging
logger = logging.getLogger(__file__)
... | true | true |
f77b3ceb9942142e8a20342f7a7851f1d5d9ffad | 22,023 | py | Python | mmpose/core/evaluation/top_down_eval.py | jcwon0/BlurHPE | c97a57e92a8a7f171b0403aee640222a32513562 | [
"Apache-2.0"
] | null | null | null | mmpose/core/evaluation/top_down_eval.py | jcwon0/BlurHPE | c97a57e92a8a7f171b0403aee640222a32513562 | [
"Apache-2.0"
] | null | null | null | mmpose/core/evaluation/top_down_eval.py | jcwon0/BlurHPE | c97a57e92a8a7f171b0403aee640222a32513562 | [
"Apache-2.0"
] | null | null | null | import warnings
import cv2
import numpy as np
from mmpose.core.post_processing import transform_preds
def _calc_distances(preds, targets, mask, normalize):
"""Calculate the normalized distances between preds and target.
Note:
batch_size: N
num_keypoints: K
dimension of... | 38.30087 | 80 | 0.581982 | import warnings
import cv2
import numpy as np
from mmpose.core.post_processing import transform_preds
def _calc_distances(preds, targets, mask, normalize):
N, K, _ = preds.shape
distances = np.full((N, K), -1, dtype=np.float32)
distances[mask] = np.linalg.norm(
((preds - targets) / n... | true | true |
f77b3cfbc43431f1861f498eccc5bfc4ad10ed61 | 3,102 | py | Python | startrek-py/startrek/fsm/runner.py | moky/wormhole | bbfcfce13eb0ee86f8bb006deb7a3881173352c2 | [
"MIT"
] | 5 | 2020-05-24T03:35:00.000Z | 2021-06-05T00:27:54.000Z | startrek-py/startrek/fsm/runner.py | moky/wormhole | bbfcfce13eb0ee86f8bb006deb7a3881173352c2 | [
"MIT"
] | null | null | null | startrek-py/startrek/fsm/runner.py | moky/wormhole | bbfcfce13eb0ee86f8bb006deb7a3881173352c2 | [
"MIT"
] | 2 | 2020-09-11T05:29:11.000Z | 2022-03-13T15:45:22.000Z | # -*- coding: utf-8 -*-
#
# Finite State Machine
#
# Written in 2021 by Moky <albert.moky@gmail.com>
#
# ==============================================================================
# MIT License
#
# Copyright (c) 2021 Albert Moky
#
# Permission is hereby granted, free of charge, to a... | 24.619048 | 80 | 0.599291 |
import time
from abc import ABC, abstractmethod
class Ticker(ABC):
@abstractmethod
def tick(self):
raise NotImplemented
class Processor(ABC):
@abstractmethod
def process(self) -> bool:
raise NotImplemented
class Handler(ABC):
@abstractmethod
def setup(self):
rai... | true | true |
f77b3d9b0ab60ca84e13572e8f7e377c933599b1 | 631 | py | Python | Python/mp4_to_mp3.py | astro-ravi/Hacktoberfest2021-1 | 0b3c3a535cab43c7334d7465a76d35d584aaa349 | [
"MIT"
] | 20 | 2021-10-06T13:51:46.000Z | 2021-11-11T16:12:17.000Z | Python/mp4_to_mp3.py | astro-ravi/Hacktoberfest2021-1 | 0b3c3a535cab43c7334d7465a76d35d584aaa349 | [
"MIT"
] | 42 | 2021-10-08T09:49:17.000Z | 2021-10-21T23:18:39.000Z | Python/mp4_to_mp3.py | astro-ravi/Hacktoberfest2021-1 | 0b3c3a535cab43c7334d7465a76d35d584aaa349 | [
"MIT"
] | 97 | 2021-10-06T13:04:34.000Z | 2021-11-11T16:12:21.000Z | from pytube import YouTube
import pytube
import os
def main():
video_url = input('Enter YouTube video URL: ')
if os.name == 'nt':
path = os.getcwd() + '\\'
else:
path = os.getcwd() + '/'
name = pytube.extract.video_id(video_url)
YouTube(video_url).streams.filter(only_audio=True).f... | 25.24 | 86 | 0.59588 | from pytube import YouTube
import pytube
import os
def main():
video_url = input('Enter YouTube video URL: ')
if os.name == 'nt':
path = os.getcwd() + '\\'
else:
path = os.getcwd() + '/'
name = pytube.extract.video_id(video_url)
YouTube(video_url).streams.filter(only_audio=True).f... | true | true |
f77b3dcd0bf5239f78153a60b084c64b52475f55 | 160,820 | py | Python | jax/numpy/lax_numpy.py | gully/jax | eb086f9b22154104b216b22ed006264989bcad41 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | jax/numpy/lax_numpy.py | gully/jax | eb086f9b22154104b216b22ed006264989bcad41 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | jax/numpy/lax_numpy.py | gully/jax | eb086f9b22154104b216b22ed006264989bcad41 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2020-08-28T18:42:08.000Z | 2020-08-28T18:42:08.000Z | # Copyright 2018 Google LLC
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 34.064817 | 114 | 0.67662 |
import builtins
import collections
import operator
import os
import types
from typing import Sequence, Set, Tuple, Union
import warnings
import numpy as np
import opt_einsum
from jax import jit, custom_jvp
from .vectorize import vectorize
from ._util import _wraps
from .. import core
from .. import dtypes
from ..ab... | true | true |
f77b3eb5cd1e038971008e0f97221ebbc87cb89b | 1,453 | py | Python | rmstripes/stripes.py | DHI-GRAS/rmstripes | 08012961959275ad7bc4731da9b4da3d90597c76 | [
"MIT"
] | 5 | 2020-02-11T05:21:14.000Z | 2021-05-19T03:53:43.000Z | rmstripes/stripes.py | DHI-GRAS/rmstripes | 08012961959275ad7bc4731da9b4da3d90597c76 | [
"MIT"
] | null | null | null | rmstripes/stripes.py | DHI-GRAS/rmstripes | 08012961959275ad7bc4731da9b4da3d90597c76 | [
"MIT"
] | 3 | 2019-01-15T03:20:08.000Z | 2021-02-08T11:14:28.000Z | import numpy as np
import pywt
def damp_coefficient(coeff, sigma):
"""Filter DWT coefficients by performing an FFT and applying a Gaussian
kernel.
"""
fft_coeff = np.fft.fft(coeff, axis=0)
fft_coeff = np.fft.fftshift(fft_coeff, axes=[0])
ydim, _ = fft_coeff.shape
gauss1d = 1 - np.exp(-np.... | 29.06 | 79 | 0.654508 | import numpy as np
import pywt
def damp_coefficient(coeff, sigma):
fft_coeff = np.fft.fft(coeff, axis=0)
fft_coeff = np.fft.fftshift(fft_coeff, axes=[0])
ydim, _ = fft_coeff.shape
gauss1d = 1 - np.exp(-np.arange(-ydim // 2, ydim // 2)**2 / (2 * sigma**2))
damped_fc = fft_coeff * gauss1d[:, np.new... | true | true |
f77b3ec51c863433e28b340c44c9b51d725c8d33 | 142 | py | Python | backend-project/small_eod/features/admin.py | WlodzimierzKorza/small_eod | 027022bd71122a949a2787d0fb86518df80e48cd | [
"MIT"
] | 64 | 2019-12-30T11:24:03.000Z | 2021-06-24T01:04:56.000Z | backend-project/small_eod/features/admin.py | WlodzimierzKorza/small_eod | 027022bd71122a949a2787d0fb86518df80e48cd | [
"MIT"
] | 465 | 2018-06-13T21:43:43.000Z | 2022-01-04T23:33:56.000Z | backend-project/small_eod/features/admin.py | WlodzimierzKorza/small_eod | 027022bd71122a949a2787d0fb86518df80e48cd | [
"MIT"
] | 72 | 2018-12-02T19:47:03.000Z | 2022-01-04T22:54:49.000Z | from django.contrib import admin
from .models import Feature, FeatureOption
admin.site.register(Feature)
admin.site.register(FeatureOption)
| 20.285714 | 42 | 0.830986 | from django.contrib import admin
from .models import Feature, FeatureOption
admin.site.register(Feature)
admin.site.register(FeatureOption)
| true | true |
f77b3ee99dfc85c90c31a8354194fee6845aca4d | 12,905 | py | Python | boltons/formatutils.py | ofek/boltons | 395f690f4a24331c4554e2169ac18a15955a4eab | [
"BSD-3-Clause"
] | 6,058 | 2015-03-18T16:44:39.000Z | 2022-03-28T08:42:16.000Z | boltons/formatutils.py | ofek/boltons | 395f690f4a24331c4554e2169ac18a15955a4eab | [
"BSD-3-Clause"
] | 289 | 2015-04-09T23:09:24.000Z | 2022-03-30T00:29:33.000Z | boltons/formatutils.py | ofek/boltons | 395f690f4a24331c4554e2169ac18a15955a4eab | [
"BSD-3-Clause"
] | 407 | 2015-04-09T20:09:15.000Z | 2022-03-30T10:43:22.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2013, Mahmoud Hashemi
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of condit... | 35.356164 | 93 | 0.646261 |
from __future__ import print_function
import re
from string import Formatter
try:
unicode except NameError:
unicode = str
__all__ = ['DeferredValue', 'get_format_args', 'tokenize_format_str',
'construct_format_field_str', 'infer_positional_format_args',
'BaseFormatField']
_... | true | true |
f77b3f51a3ca2f9fa57710e97f56c72509668c65 | 2,649 | py | Python | nova/common/memorycache.py | bopopescu/zknova | 8dd09199f5678697be228ffceeaf2c16f6d7319d | [
"Apache-2.0"
] | null | null | null | nova/common/memorycache.py | bopopescu/zknova | 8dd09199f5678697be228ffceeaf2c16f6d7319d | [
"Apache-2.0"
] | null | null | null | nova/common/memorycache.py | bopopescu/zknova | 8dd09199f5678697be228ffceeaf2c16f6d7319d | [
"Apache-2.0"
] | 1 | 2020-07-24T08:25:25.000Z | 2020-07-24T08:25:25.000Z | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compli... | 31.164706 | 78 | 0.643639 |
from nova.openstack.common import cfg
from nova.openstack.common import timeutils
memcache_opts = [
cfg.ListOpt('memcached_servers',
default=None,
help='Memcached servers or None for in process cache.'),
]
CONF = cfg.CONF
CONF.register_opts(memcache_opts)
def get_client():
... | true | true |
f77b4038028a557fa143bb1b9877ea4edd11d0c0 | 21,372 | py | Python | backend/tests/views/test_schedule_view_set.py | crosspower/naruko | 4c524e2ef955610a711830bc86d730ffe4fc2bd8 | [
"MIT"
] | 17 | 2019-01-23T04:37:43.000Z | 2019-10-15T01:42:31.000Z | backend/tests/views/test_schedule_view_set.py | snickerjp/naruko | 4c524e2ef955610a711830bc86d730ffe4fc2bd8 | [
"MIT"
] | 1 | 2019-01-23T08:04:44.000Z | 2019-01-23T08:44:33.000Z | backend/tests/views/test_schedule_view_set.py | snickerjp/naruko | 4c524e2ef955610a711830bc86d730ffe4fc2bd8 | [
"MIT"
] | 6 | 2019-01-23T09:10:59.000Z | 2020-12-02T04:15:41.000Z | from botocore.exceptions import ClientError
from django.test import TestCase
from rest_framework.test import APIClient
from backend.models import UserModel, RoleModel, TenantModel, AwsEnvironmentModel, Schedule, ScheduleModel,\
CloudWatchEvent
from datetime import datetime
from unittest import mock
@mock... | 34.415459 | 109 | 0.592879 | from botocore.exceptions import ClientError
from django.test import TestCase
from rest_framework.test import APIClient
from backend.models import UserModel, RoleModel, TenantModel, AwsEnvironmentModel, Schedule, ScheduleModel,\
CloudWatchEvent
from datetime import datetime
from unittest import mock
@mock... | true | true |
f77b4060eabe9cec1f35657e8fa9d829c05e989b | 1,893 | py | Python | maskrcnn_benchmark/modeling/roi_heads/keypoint_head/roi_keypoint_feature_extractors.py | cxq1/paddle_VinVL | f9136871c43b033cd209ddc7579fa986208e37db | [
"MIT"
] | null | null | null | maskrcnn_benchmark/modeling/roi_heads/keypoint_head/roi_keypoint_feature_extractors.py | cxq1/paddle_VinVL | f9136871c43b033cd209ddc7579fa986208e37db | [
"MIT"
] | null | null | null | maskrcnn_benchmark/modeling/roi_heads/keypoint_head/roi_keypoint_feature_extractors.py | cxq1/paddle_VinVL | f9136871c43b033cd209ddc7579fa986208e37db | [
"MIT"
] | null | null | null | from paddle import nn
from paddle.nn import functional as F
from maskrcnn_benchmark.modeling import registry
from maskrcnn_benchmark.modeling.poolers import Pooler
from maskrcnn_benchmark.layers import Conv2d
@registry.ROI_KEYPOINT_FEATURE_EXTRACTORS.register("KeypointRCNNFeatureExtractor")
class KeypointRCNNFeatur... | 37.117647 | 87 | 0.699419 | from paddle import nn
from paddle.nn import functional as F
from maskrcnn_benchmark.modeling import registry
from maskrcnn_benchmark.modeling.poolers import Pooler
from maskrcnn_benchmark.layers import Conv2d
@registry.ROI_KEYPOINT_FEATURE_EXTRACTORS.register("KeypointRCNNFeatureExtractor")
class KeypointRCNNFeatur... | true | true |
f77b41adf6bc4cb68624d2ac401effc3439bdb84 | 638 | py | Python | misc/mymisc/textonly-training.py | xiaomin418/XVLP | 47703a46e29ac9f8c6052c116ac38c9cae9a68ad | [
"Apache-2.0"
] | null | null | null | misc/mymisc/textonly-training.py | xiaomin418/XVLP | 47703a46e29ac9f8c6052c116ac38c9cae9a68ad | [
"Apache-2.0"
] | null | null | null | misc/mymisc/textonly-training.py | xiaomin418/XVLP | 47703a46e29ac9f8c6052c116ac38c9cae9a68ad | [
"Apache-2.0"
] | null | null | null |
vis_embedding_dim = 512
len_vis_input = 49
vis_input = False
pretrain_mode = 'train'
dev_data_gen = False
dev_data_file_load = False
return_the_img_path = False # return_the_img_path = True when pretrain_mode == 'test'
dev_npy_dir = '/data/meihuan2/dataset/SS_MLM/1213-testnpy/'
result_multimodal_file = '/data/meihuan2... | 35.444444 | 94 | 0.805643 |
vis_embedding_dim = 512
len_vis_input = 49
vis_input = False
pretrain_mode = 'train'
dev_data_gen = False
dev_data_file_load = False
return_the_img_path = False dev_npy_dir = '/data/meihuan2/dataset/SS_MLM/1213-testnpy/'
result_multimodal_file = '/data/meihuan2/dataset/SS_MLM/1213-testnpy/result_multimodal.pickle'
res... | true | true |
f77b42421b131983c10cb0989bc16a91a1b97439 | 10,784 | py | Python | pyslim/methods.py | chriscrsmith/pyslim | babfedf4e9758e00ea431cc6d6ce74642796ee38 | [
"MIT"
] | 20 | 2018-06-22T09:43:38.000Z | 2022-02-28T04:40:49.000Z | pyslim/methods.py | chriscrsmith/pyslim | babfedf4e9758e00ea431cc6d6ce74642796ee38 | [
"MIT"
] | 202 | 2018-06-20T14:40:09.000Z | 2022-03-12T18:13:59.000Z | pyslim/methods.py | chriscrsmith/pyslim | babfedf4e9758e00ea431cc6d6ce74642796ee38 | [
"MIT"
] | 20 | 2018-06-27T23:42:04.000Z | 2022-01-31T18:12:09.000Z | import msprime
import tskit
import warnings
import numpy as np
from .slim_tree_sequence import *
from .slim_metadata import *
from .provenance import *
from .util import *
def recapitate(ts,
ancestral_Ne=None,
**kwargs):
'''
Returns a "recapitated" tree sequence, by using msprime... | 43.659919 | 95 | 0.64809 | import msprime
import tskit
import warnings
import numpy as np
from .slim_tree_sequence import *
from .slim_metadata import *
from .provenance import *
from .util import *
def recapitate(ts,
ancestral_Ne=None,
**kwargs):
demography = None
if "demography" in kwargs:
demogr... | true | true |
f77b426636dac640ffb53ecc57c622695ddd5864 | 2,110 | py | Python | Tests/Validation/Machine/SCIM_006.py | helene-t/pyleecan | 8362de9b0e32b346051b38192e07f3a6974ea9aa | [
"Apache-2.0"
] | null | null | null | Tests/Validation/Machine/SCIM_006.py | helene-t/pyleecan | 8362de9b0e32b346051b38192e07f3a6974ea9aa | [
"Apache-2.0"
] | null | null | null | Tests/Validation/Machine/SCIM_006.py | helene-t/pyleecan | 8362de9b0e32b346051b38192e07f3a6974ea9aa | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""Validation machine of a polar SCIM
From publication:
K. Boughrara
Analytical Analysis of Cage Rotor Induction Motors in Healthy, Defective and Broken Bars Conditions
IEEE Trans on Mag, 2014
"""
from numpy import pi
from pyleecan.Classes.CondType12 import CondType12
from pyleecan.Classes.CondT... | 30.57971 | 99 | 0.766351 | from numpy import pi
from pyleecan.Classes.CondType12 import CondType12
from pyleecan.Classes.CondType21 import CondType21
from pyleecan.Classes.Frame import Frame
from pyleecan.Classes.LamSlotWind import LamSlotWind
from pyleecan.Classes.MachineSCIM import MachineSCIM
from pyleecan.Classes.LamSquirrelCage import LamSq... | true | true |
f77b443960200818ea22cfbb282453bee80604f5 | 1,586 | py | Python | StoreData.py | Pratiush/Raspberry-pi-Home-security | 56002e98de4d085a500e81f61935f791d54682d2 | [
"MIT"
] | null | null | null | StoreData.py | Pratiush/Raspberry-pi-Home-security | 56002e98de4d085a500e81f61935f791d54682d2 | [
"MIT"
] | null | null | null | StoreData.py | Pratiush/Raspberry-pi-Home-security | 56002e98de4d085a500e81f61935f791d54682d2 | [
"MIT"
] | null | null | null | import cv2,os
import numpy as np
from PIL import Image
cam = cv2.VideoCapture(0)
recognizer = cv2.createLBPHFaceRecognizer()
detector=cv2.CascadeClassifier('frontface.xml')
'''
Below function converts data into yml
'''
def getImagesAndLabels(path):
imagePaths=[os.path.join(path,f) for f in os.listdi... | 29.924528 | 89 | 0.631148 | import cv2,os
import numpy as np
from PIL import Image
cam = cv2.VideoCapture(0)
recognizer = cv2.createLBPHFaceRecognizer()
detector=cv2.CascadeClassifier('frontface.xml')
def getImagesAndLabels(path):
imagePaths=[os.path.join(path,f) for f in os.listdir(path)]
faceSamples=[]
Ids=[]
fo... | true | true |
f77b445ff2ddd2417f49f9892c40eaccc2d5f1d7 | 1,480 | py | Python | RIPRouter/analyze_updates.py | jasonaibrahim/AcademicWorks | 4c3e75f48bdafa02fabb551beb6ebf2fea871238 | [
"MIT"
] | null | null | null | RIPRouter/analyze_updates.py | jasonaibrahim/AcademicWorks | 4c3e75f48bdafa02fabb551beb6ebf2fea871238 | [
"MIT"
] | null | null | null | RIPRouter/analyze_updates.py | jasonaibrahim/AcademicWorks | 4c3e75f48bdafa02fabb551beb6ebf2fea871238 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import sys
import time
import sim
_ENABLE_GUI = "--gui" in sys.argv
# If you don't want to see log messages on the console, uncomment the
# following line. You might want to do this if you are using the GUI
# which displays logs itself.
_DISABLE_CONSOLE_LOG = True
from rip_router import RIPRo... | 27.924528 | 72 | 0.760135 |
import sys
import time
import sim
_ENABLE_GUI = "--gui" in sys.argv
# following line. You might want to do this if you are using the GUI
# which displays logs itself.
_DISABLE_CONSOLE_LOG = True
from rip_router import RIPRouter as switch
import sim.core
import scenarios
time.sleep(1) # Wait a sec for log client ... | false | true |
f77b448d32d035007ad59bc9009f4d43ca8d4e64 | 2,002 | py | Python | utilities/mini_batch_gradient_descent.py | Puneethnaik/Generative-Adversarial-Networks | 283abe2caaccbb99e1516b2a3f251cd8d005a386 | [
"MIT"
] | null | null | null | utilities/mini_batch_gradient_descent.py | Puneethnaik/Generative-Adversarial-Networks | 283abe2caaccbb99e1516b2a3f251cd8d005a386 | [
"MIT"
] | null | null | null | utilities/mini_batch_gradient_descent.py | Puneethnaik/Generative-Adversarial-Networks | 283abe2caaccbb99e1516b2a3f251cd8d005a386 | [
"MIT"
] | null | null | null | import numpy as np
#This is crafted especially for normal distribution for MLE.
class GradientDescentOptimizer:
def __init__(self, X, tolerance, learning_rate):
self.learning_rate = learning_rate
self.tolerance = tolerance
self.X = X
if(len(X.shape) == 1):
self.number_of... | 50.05 | 193 | 0.583916 | import numpy as np
class GradientDescentOptimizer:
def __init__(self, X, tolerance, learning_rate):
self.learning_rate = learning_rate
self.tolerance = tolerance
self.X = X
if(len(X.shape) == 1):
self.number_of_points = X.shape[0]
self.number_of_variables = 2... | true | true |
f77b453a279bb05f068d1e0720e55233e2a5eb42 | 16,668 | py | Python | plugins/user_quota/girder_user_quota/quota.py | RemiCecchinato/girder | 455d5c60d59112b65b45daf51c2d2ccda2e84a9a | [
"Apache-2.0"
] | null | null | null | plugins/user_quota/girder_user_quota/quota.py | RemiCecchinato/girder | 455d5c60d59112b65b45daf51c2d2ccda2e84a9a | [
"Apache-2.0"
] | null | null | null | plugins/user_quota/girder_user_quota/quota.py | RemiCecchinato/girder | 455d5c60d59112b65b45daf51c2d2ccda2e84a9a | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import six
from bson.objectid import ObjectId, InvalidId
from girder import logger
from girder.api import access
from girder.api.describe import Description, autoDescribeRoute
from girder.api.rest import Resource
from girder.constants import AccessType
from girder.exceptions import GirderExcept... | 40.554745 | 93 | 0.606371 | import six
from bson.objectid import ObjectId, InvalidId
from girder import logger
from girder.api import access
from girder.api.describe import Description, autoDescribeRoute
from girder.api.rest import Resource
from girder.constants import AccessType
from girder.exceptions import GirderException, ValidationException... | true | true |
f77b4567aa263e9e7f2c64ef1089c0e874aad317 | 10,190 | py | Python | pytorch_lightning/loops/dataloader/evaluation_loop.py | rharish101/pytorch-lightning | ffb1a754af5301608c71955c12468216e920af51 | [
"Apache-2.0"
] | 1 | 2021-06-25T18:10:19.000Z | 2021-06-25T18:10:19.000Z | pytorch_lightning/loops/dataloader/evaluation_loop.py | rharish101/pytorch-lightning | ffb1a754af5301608c71955c12468216e920af51 | [
"Apache-2.0"
] | null | null | null | pytorch_lightning/loops/dataloader/evaluation_loop.py | rharish101/pytorch-lightning | ffb1a754af5301608c71955c12468216e920af51 | [
"Apache-2.0"
] | 2 | 2021-12-08T22:29:39.000Z | 2022-03-26T04:46:09.000Z | # Copyright The PyTorch Lightning team.
#
# 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 i... | 41.422764 | 119 | 0.674387 | from typing import Any, List, Sequence, Union
from deprecate.utils import void
from torch.utils.data.dataloader import DataLoader
from pytorch_lightning.loops.dataloader import DataLoaderLoop
from pytorch_lightning.loops.epoch import EvaluationEpochLoop
from pytorch_lightning.trainer.connectors.logger_connector.resul... | true | true |
f77b45ae881b00a9f40edb52f7f313cad74bc3f8 | 132 | py | Python | scripts/settings_example.py | Fu-Om/bitFlyer-dca | dcb0e511b602b90e8b89efb67d93387ed69e8b9e | [
"MIT"
] | null | null | null | scripts/settings_example.py | Fu-Om/bitFlyer-dca | dcb0e511b602b90e8b89efb67d93387ed69e8b9e | [
"MIT"
] | null | null | null | scripts/settings_example.py | Fu-Om/bitFlyer-dca | dcb0e511b602b90e8b89efb67d93387ed69e8b9e | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# Obtain api key and secret and name it settings.py
BITFLYER_API_KEY = 'XXXXX'
BITFLYER_API_SECRET = 'XXXXX'
| 22 | 51 | 0.757576 |
BITFLYER_API_KEY = 'XXXXX'
BITFLYER_API_SECRET = 'XXXXX'
| true | true |
f77b4644855cf34197dad5e5f02aa2563574e20b | 1,202 | py | Python | iktomi/storage.py | boltnev/iktomi | bc92006c026f9b42e56f1af5ced2fe577673a486 | [
"MIT"
] | 14 | 2015-02-15T05:24:22.000Z | 2020-03-19T10:07:28.000Z | iktomi/storage.py | boltnev/iktomi | bc92006c026f9b42e56f1af5ced2fe577673a486 | [
"MIT"
] | 10 | 2015-04-04T10:10:41.000Z | 2016-06-01T13:17:58.000Z | iktomi/storage.py | boltnev/iktomi | bc92006c026f9b42e56f1af5ced2fe577673a486 | [
"MIT"
] | 5 | 2015-02-20T11:18:58.000Z | 2016-10-18T15:30:13.000Z | # -*- coding: utf-8 -*-
class Storage(object):
def set(self, key, value, time=0):# pragma: no cover
raise NotImplementedError()
def get(self, key, default=None):# pragma: no cover
raise NotImplementedError()
def delete(self, key):# pragma: no cover
raise NotImplementedError()
cla... | 25.574468 | 66 | 0.609817 |
class Storage(object):
def set(self, key, value, time=0): raise NotImplementedError()
def get(self, key, default=None): raise NotImplementedError()
def delete(self, key): raise NotImplementedError()
class LocalMemStorage(Storage):
def __init__(self):
self.storage = {}
... | true | true |
f77b468461cab5f4d732e3c2ad87edce005201e7 | 4,150 | py | Python | contrib/python/scipy/scipy/_lib/_numpy_compat.py | mjjohns1/catboost | 08719381259ab93f00b8e350433f67ae9782fef6 | [
"Apache-2.0"
] | 6,989 | 2017-07-18T06:23:18.000Z | 2022-03-31T15:58:36.000Z | contrib/python/scipy/scipy/_lib/_numpy_compat.py | mjjohns1/catboost | 08719381259ab93f00b8e350433f67ae9782fef6 | [
"Apache-2.0"
] | 1,978 | 2017-07-18T09:17:58.000Z | 2022-03-31T14:28:43.000Z | contrib/python/scipy/scipy/_lib/_numpy_compat.py | mjjohns1/catboost | 08719381259ab93f00b8e350433f67ae9782fef6 | [
"Apache-2.0"
] | 1,228 | 2017-07-18T09:03:13.000Z | 2022-03-29T05:57:40.000Z | """Functions copypasted from newer versions of numpy.
"""
from __future__ import division, print_function, absolute_import
import warnings
import sys
import numpy as np
from numpy.testing._private.nosetester import import_nose
from scipy._lib._version import NumpyVersion
if NumpyVersion(np.__version__) > '1.7.0.de... | 37.053571 | 82 | 0.631325 | from __future__ import division, print_function, absolute_import
import warnings
import sys
import numpy as np
from numpy.testing._private.nosetester import import_nose
from scipy._lib._version import NumpyVersion
if NumpyVersion(np.__version__) > '1.7.0.dev':
_assert_warns = np.testing.assert_warns
else:
d... | true | true |
f77b47516a24a9f4673d186b31660cc3b2468383 | 3,180 | py | Python | corehq/apps/es/cases.py | omari-funzone/commcare-hq | 5edb462c891fc08e51c4babd7acdf12c0006a602 | [
"BSD-3-Clause"
] | 471 | 2015-01-10T02:55:01.000Z | 2022-03-29T18:07:18.000Z | corehq/apps/es/cases.py | omari-funzone/commcare-hq | 5edb462c891fc08e51c4babd7acdf12c0006a602 | [
"BSD-3-Clause"
] | 14,354 | 2015-01-01T07:38:23.000Z | 2022-03-31T20:55:14.000Z | corehq/apps/es/cases.py | omari-funzone/commcare-hq | 5edb462c891fc08e51c4babd7acdf12c0006a602 | [
"BSD-3-Clause"
] | 175 | 2015-01-06T07:16:47.000Z | 2022-03-29T13:27:01.000Z | """
CaseES
------
Here's an example getting pregnancy cases that are either still open or were
closed after May 1st.
.. code-block:: python
from corehq.apps.es import cases as case_es
q = (case_es.CaseES()
.domain('testproject')
.case_type('pregnancy')
.OR(case_es.is_closed(False)... | 23.555556 | 82 | 0.637736 | from . import aggregations, filters
from .es_query import HQESQuery
class CaseES(HQESQuery):
index = 'cases'
@property
def builtin_filters(self):
return [
opened_range,
closed_range,
modified_range,
server_modified_range,
case_name,
... | true | true |
f77b47645cc8f0202e6d6d4a0c7b7f02e1edef52 | 5,493 | py | Python | server/auvsi_suas/models/access_log.py | dcat52/interop | b016b2c25e468e21649bdb7475d828198b5e6958 | [
"Apache-2.0"
] | null | null | null | server/auvsi_suas/models/access_log.py | dcat52/interop | b016b2c25e468e21649bdb7475d828198b5e6958 | [
"Apache-2.0"
] | null | null | null | server/auvsi_suas/models/access_log.py | dcat52/interop | b016b2c25e468e21649bdb7475d828198b5e6958 | [
"Apache-2.0"
] | null | null | null | """Model for an access log."""
import datetime
import numpy as np
from time_period import TimePeriod
from django.conf import settings
from django.db import models
from django.utils import timezone
class AccessLog(models.Model):
"""Base class which logs access of information.
Attributes:
user: The us... | 38.957447 | 80 | 0.616421 |
import datetime
import numpy as np
from time_period import TimePeriod
from django.conf import settings
from django.db import models
from django.utils import timezone
class AccessLog(models.Model):
user = models.ForeignKey(settings.AUTH_USER_MODEL, db_index=True)
timestamp = models.DateTimeField(auto_now_add=... | true | true |
f77b47bc6322ee90867f5ec517b0e025953487db | 4,030 | py | Python | core-services/prow/02_config/generate-boskos.py | opdev/release | 551fe7dd8abeb3ae395f1fa883fb1c71ecf61e1f | [
"Apache-2.0"
] | null | null | null | core-services/prow/02_config/generate-boskos.py | opdev/release | 551fe7dd8abeb3ae395f1fa883fb1c71ecf61e1f | [
"Apache-2.0"
] | null | null | null | core-services/prow/02_config/generate-boskos.py | opdev/release | 551fe7dd8abeb3ae395f1fa883fb1c71ecf61e1f | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
import yaml
CONFIG = {
'aws-arm64-quota-slice': {
# Wild guesses. We'll see when we hit quota issues
'us-east-1': 10,
'us-east-2': 8,
'us-west-1': 8,
'us-west-2': 8,
},
'aws-quota-slice': {
# Wild guesses. We'll see when we hit quo... | 27.22973 | 154 | 0.533995 |
import yaml
CONFIG = {
'aws-arm64-quota-slice': {
'us-east-1': 10,
'us-east-2': 8,
'us-west-1': 8,
'us-west-2': 8,
},
'aws-quota-slice': {
# Wild guesses. We'll see when we hit quota issues
'us-east-1': 50,
'us-east-2': 35,
'us-wes... | true | true |
f77b4c5b5564044198a88240ca1b2746003341cd | 488 | py | Python | others/count_primes.py | lycheng/leetcode | 88f0a0eb377fbf9d233e599736c740bb83b8ccef | [
"MIT"
] | null | null | null | others/count_primes.py | lycheng/leetcode | 88f0a0eb377fbf9d233e599736c740bb83b8ccef | [
"MIT"
] | null | null | null | others/count_primes.py | lycheng/leetcode | 88f0a0eb377fbf9d233e599736c740bb83b8ccef | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
class Solution(object):
''' https://leetcode.com/problems/count-primes/
'''
def countPrimes(self, n):
if n <= 2:
return 0
is_prime = [True] * n
ret = 0
for i in range(2, n):
if not is_prime[i]:
continue
... | 20.333333 | 51 | 0.409836 |
class Solution(object):
def countPrimes(self, n):
if n <= 2:
return 0
is_prime = [True] * n
ret = 0
for i in range(2, n):
if not is_prime[i]:
continue
ret += 1
for m in range(2, n):
if i * m >= n:
... | true | true |
f77b4d498d969c6b7dd15be22da5c7f875fffbf4 | 18,164 | py | Python | objc/encoding.py | dgelessus/objc-cffi | 9a00e18932e3314aa50b22400cacc1a67b7e933d | [
"MIT"
] | 7 | 2016-12-03T23:02:32.000Z | 2021-04-25T22:41:00.000Z | objc/encoding.py | dgelessus/objc-cffi | 9a00e18932e3314aa50b22400cacc1a67b7e933d | [
"MIT"
] | null | null | null | objc/encoding.py | dgelessus/objc-cffi | 9a00e18932e3314aa50b22400cacc1a67b7e933d | [
"MIT"
] | null | null | null | import functools
__all__ = [
"_C_ARY_B",
"_C_ARY_E",
"_C_BFLD",
"_C_BOOL",
"_C_BYCOPY",
"_C_BYREF",
"_C_CHARPTR",
"_C_CHR",
"_C_CLASS",
"_C_CONST",
"_C_DBL",
"_C_FLT",
"_C_ID",
"_C_IN",
"_C_INOUT",
"_C_INT",
"_C_LNG",
"_C_LNG_LNG",
"_C_ONEWAY",
"_C_OUT",
"_C_PTR",
"_C_SEL",
"_C_SHT",
"_C_STRUCT... | 26.594436 | 378 | 0.669236 | import functools
__all__ = [
"_C_ARY_B",
"_C_ARY_E",
"_C_BFLD",
"_C_BOOL",
"_C_BYCOPY",
"_C_BYREF",
"_C_CHARPTR",
"_C_CHR",
"_C_CLASS",
"_C_CONST",
"_C_DBL",
"_C_FLT",
"_C_ID",
"_C_IN",
"_C_INOUT",
"_C_INT",
"_C_LNG",
"_C_LNG_LNG",
"_C_ONEWAY",
"_C_OUT",
"_C_PTR",
"_C_SEL",
"_C_SHT",
"_C_STRUCT... | true | true |
f77b4eccac80a014f44320cef964b648b3460bc0 | 3,999 | py | Python | cp2/cp2_method23.py | jet-code/multivariable-control-systems | 81b57d51a4dfc92964f989794f71d525af0359ff | [
"MIT"
] | null | null | null | cp2/cp2_method23.py | jet-code/multivariable-control-systems | 81b57d51a4dfc92964f989794f71d525af0359ff | [
"MIT"
] | null | null | null | cp2/cp2_method23.py | jet-code/multivariable-control-systems | 81b57d51a4dfc92964f989794f71d525af0359ff | [
"MIT"
] | null | null | null |
# coding: utf-8
# In[1]:
# Alexander Hebert
# ECE 6390
# Computer Project #2
# Method 2/3
# In[2]:
# Tested using Python v3.4 and IPython v2
##### Import libraries and functions
# In[3]:
import numpy as np
# In[4]:
from PlaneRotationFn import planeRotation1
from PlaneRotationFn import planeRotation2
# In... | 11.625 | 103 | 0.541885 |
import numpy as np
from PlaneRotationFn import planeRotation1
from PlaneRotationFn import planeRotation2
import scipy
import sympy
from IPython.display import display
from sympy.interactive import printing
np.set_printoptions(precision=6)
A = np.loadtxt('A_ex1.txt')
A
n,nc = A.s... | true | true |
f77b4f897cfc26ed422ac1b5861bc333b779dc0c | 898 | py | Python | 1-9/p_7.py | rikgj/Project-Euler-1-100 | 965b86ba102259a7d55613b065d109e6117eb7e8 | [
"MIT"
] | null | null | null | 1-9/p_7.py | rikgj/Project-Euler-1-100 | 965b86ba102259a7d55613b065d109e6117eb7e8 | [
"MIT"
] | null | null | null | 1-9/p_7.py | rikgj/Project-Euler-1-100 | 965b86ba102259a7d55613b065d109e6117eb7e8 | [
"MIT"
] | null | null | null | '''
By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see that the 6th prime is 13.
What is the 10 001st prime number?
'''
import math
# this needs to be high in order to find enough primes
limit = 1000000
# create a list with limit+1 entries all set to True
list = [True] * (limit+1)
i = 2
limit... | 22.45 | 100 | 0.591314 |
import math
limit = 1000000
list = [True] * (limit+1)
i = 2
limit_i = math.floor(math.sqrt(limit))
while i <= limit_i:
if(list[i]):
n=0
i2 = i**2
j = i2
while j < limit:
list[j] = False
n+=1
j = i2 + i*n
i+=1
primes = [1]
inde... | true | true |
f77b5051a7ff35ca1e3f57dbf446a14f29689528 | 8,901 | py | Python | helpers/conversion.py | ettmetal/ChessMoveGAN | 206ecfbab1b8c4ffde76850d90579d33dcdcac49 | [
"MIT"
] | null | null | null | helpers/conversion.py | ettmetal/ChessMoveGAN | 206ecfbab1b8c4ffde76850d90579d33dcdcac49 | [
"MIT"
] | null | null | null | helpers/conversion.py | ettmetal/ChessMoveGAN | 206ecfbab1b8c4ffde76850d90579d33dcdcac49 | [
"MIT"
] | null | null | null | import chess
import math
from .coordinates import *
# -- Magic values ------------------------------------------------------------------------------------------------------
AZ_MOVE_COUNT = 4672
AZ_INDEX_NONE = -1
AZ_SHAPE = (8, 8, 73)
UNDERPROMOTIONS_SHAPE = (3, 3)
PROMOTION_PIECE_MODIFIER = 2
QUEEN_MOVE_SHAPE = ... | 40.830275 | 132 | 0.633974 | import chess
import math
from .coordinates import *
AZ_MOVE_COUNT = 4672
AZ_INDEX_NONE = -1
AZ_SHAPE = (8, 8, 73)
UNDERPROMOTIONS_SHAPE = (3, 3)
PROMOTION_PIECE_MODIFIER = 2
QUEEN_MOVE_SHAPE = (8, 7)
def game_to_az_indices(game):
indices = [move_to_az_index(move) for move in game.mainline_moves()]
indic... | true | true |
f77b50abef72bbed53b0d0ebcbab5b77a6631814 | 30,788 | py | Python | source/libs/CMSIS/DSP/Testing/TestScripts/CodeGen.py | 1031975582/stm32f746-tflite-micro-mnist | d9240a58ef78e0076045fe04ff9d4900cb403b80 | [
"MIT"
] | 1 | 2020-10-30T07:27:07.000Z | 2020-10-30T07:27:07.000Z | source/libs/CMSIS/DSP/Testing/TestScripts/CodeGen.py | 1031975582/stm32f746-tflite-micro-mnist | d9240a58ef78e0076045fe04ff9d4900cb403b80 | [
"MIT"
] | null | null | null | source/libs/CMSIS/DSP/Testing/TestScripts/CodeGen.py | 1031975582/stm32f746-tflite-micro-mnist | d9240a58ef78e0076045fe04ff9d4900cb403b80 | [
"MIT"
] | 1 | 2020-10-30T07:27:08.000Z | 2020-10-30T07:27:08.000Z | import TestScripts.Parser
import sys
import os.path
import math
groupCode="""class %s : public Client::Group
{
public:
%s(Testing::testID_t id):Client::Group(id)
%s
{
%s
}
private:
%s;
};
"""
suiteCode="""
#include \"%s.h\"
%s::%s(Testing::testID_t id):Client::Suite(id)
... | 36.349469 | 102 | 0.543751 | import TestScripts.Parser
import sys
import os.path
import math
groupCode="""class %s : public Client::Group
{
public:
%s(Testing::testID_t id):Client::Group(id)
%s
{
%s
}
private:
%s;
};
"""
suiteCode="""
#include \"%s.h\"
%s::%s(Testing::testID_t id):Client::Suite(id)
... | true | true |
f77b512a61483fe4c3bc5b31f080e5c6ca6a1c73 | 3,127 | py | Python | manimpp/utils/tex_file_writing.py | yudhastyawan/manimpp | 5bcfa7ba24e368a72f55a3c69364521843b9766d | [
"MIT"
] | null | null | null | manimpp/utils/tex_file_writing.py | yudhastyawan/manimpp | 5bcfa7ba24e368a72f55a3c69364521843b9766d | [
"MIT"
] | null | null | null | manimpp/utils/tex_file_writing.py | yudhastyawan/manimpp | 5bcfa7ba24e368a72f55a3c69364521843b9766d | [
"MIT"
] | null | null | null | import os
import hashlib
from pathlib import Path
from manimpp.constants import TEX_TEXT_TO_REPLACE
from manimpp.constants import TEX_USE_CTEX
import manimpp.constants as consts
def tex_hash(expression, template_tex_file_body):
id_str = str(expression + template_tex_file_body)
hasher = hashlib.sha256()
... | 31.27 | 77 | 0.587144 | import os
import hashlib
from pathlib import Path
from manimpp.constants import TEX_TEXT_TO_REPLACE
from manimpp.constants import TEX_USE_CTEX
import manimpp.constants as consts
def tex_hash(expression, template_tex_file_body):
id_str = str(expression + template_tex_file_body)
hasher = hashlib.sha256()
... | true | true |
f77b5141b3e075d2236768626c9bad2bc32b11db | 6,177 | py | Python | corebio/seq_io/phylip_io.py | javicorvi/weblogo_edited | c44f2a4be40318571a8991bcbe4d5cb83e327719 | [
"MIT"
] | null | null | null | corebio/seq_io/phylip_io.py | javicorvi/weblogo_edited | c44f2a4be40318571a8991bcbe4d5cb83e327719 | [
"MIT"
] | null | null | null | corebio/seq_io/phylip_io.py | javicorvi/weblogo_edited | c44f2a4be40318571a8991bcbe4d5cb83e327719 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# Copyright (c) 2005 David D. Ding <dding@berkeley.edu>
#
# This software is distributed under the MIT Open Source License.
# <http://www.opensource.org/licenses/mit-license.html>
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associa... | 38.12963 | 101 | 0.646107 |
from __future__ import absolute_import
from ..seq import *
names = ('phylip',)
extensions = ('phy',)
def iterseq(fin, alphabet=None):
return iter(read(fin, alphabet))
def read(fin, alphabet=None):
sequence = [] idents = []
num_seq = 0
num_total_seq = 0 tracker = 0 usertree_tra... | true | true |
f77b5142c832125a1aa9c01b0e420a4872c93b50 | 33,307 | py | Python | sdk/lusid/models/resource_list_of_quote.py | rizwansaeed/lusid-sdk-python-preview | 52d092d6d4099b8526f0318f3fe1ddc0b943da6a | [
"MIT"
] | null | null | null | sdk/lusid/models/resource_list_of_quote.py | rizwansaeed/lusid-sdk-python-preview | 52d092d6d4099b8526f0318f3fe1ddc0b943da6a | [
"MIT"
] | null | null | null | sdk/lusid/models/resource_list_of_quote.py | rizwansaeed/lusid-sdk-python-preview | 52d092d6d4099b8526f0318f3fe1ddc0b943da6a | [
"MIT"
] | null | null | null | # coding: utf-8
"""
LUSID API
# Introduction This page documents the [LUSID APIs](https://www.lusid.com/api/swagger), which allows authorised clients to query and update their data within the LUSID platform. SDKs to interact with the LUSID APIs are available in the following languages : * [C#](https://gith... | 183.005495 | 28,647 | 0.68298 |
import pprint
import re
import six
class ResourceListOfQuote(object):
openapi_types = {
'values': 'list[Quote]',
'href': 'str',
'links': 'list[Link]'
}
attribute_map = {
'values': 'values',
'href': 'href',
'links': 'links'
}
required_map = {
... | true | true |
f77b5153482bacdb3babb15dbf3bda3dc464f4d2 | 3,603 | py | Python | main.py | kant/open-solution-value-prediction | 708d0958cba1b8a551a10a9959678441f3eaa1dc | [
"MIT"
] | 27 | 2018-06-29T18:38:53.000Z | 2019-08-22T21:49:19.000Z | main.py | kant/open-solution-value-prediction | 708d0958cba1b8a551a10a9959678441f3eaa1dc | [
"MIT"
] | 16 | 2018-06-19T22:15:18.000Z | 2018-06-26T09:15:59.000Z | main.py | kant/open-solution-value-prediction | 708d0958cba1b8a551a10a9959678441f3eaa1dc | [
"MIT"
] | 15 | 2018-07-01T00:28:39.000Z | 2019-08-08T01:16:24.000Z | import click
from src.pipeline_manager import PipelineManager
pipeline_manager = PipelineManager()
@click.group()
def main():
pass
@main.command()
@click.option('-p', '--pipeline_name', help='pipeline to be trained', required=True)
@click.option('-d', '--dev_mode', help='if true only a small sample of data wi... | 45.607595 | 120 | 0.752984 | import click
from src.pipeline_manager import PipelineManager
pipeline_manager = PipelineManager()
@click.group()
def main():
pass
@main.command()
@click.option('-p', '--pipeline_name', help='pipeline to be trained', required=True)
@click.option('-d', '--dev_mode', help='if true only a small sample of data wi... | true | true |
f77b51ae6ae6f2bb9bca1641d2bcfccb2a2b8edd | 1,212 | py | Python | REDSI_1160929_1161573/boost_1_67_0/tools/build/test/chain.py | Wultyc/ISEP_1718_2A2S_REDSI_TrabalhoGrupo | eb0f7ef64e188fe871f47c2ef9cdef36d8a66bc8 | [
"MIT"
] | null | null | null | REDSI_1160929_1161573/boost_1_67_0/tools/build/test/chain.py | Wultyc/ISEP_1718_2A2S_REDSI_TrabalhoGrupo | eb0f7ef64e188fe871f47c2ef9cdef36d8a66bc8 | [
"MIT"
] | null | null | null | REDSI_1160929_1161573/boost_1_67_0/tools/build/test/chain.py | Wultyc/ISEP_1718_2A2S_REDSI_TrabalhoGrupo | eb0f7ef64e188fe871f47c2ef9cdef36d8a66bc8 | [
"MIT"
] | 1 | 2019-03-08T11:06:22.000Z | 2019-03-08T11:06:22.000Z | #!/usr/bin/python
# Copyright 2003 Dave Abrahams
# Copyright 2002, 2003 Vladimir Prus
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
# This tests that :
# 1) the 'make' correctly assigns types to produced targets
... | 21.263158 | 82 | 0.622112 |
import BoostBuild
t = BoostBuild.Tester(use_test_config=False)
t.write("jamroot.jam", "import gcc ;")
t.write("jamfile.jam", r'''
import os ;
if [ os.name ] = NT
{
actions create
{
echo int main() {} > $(<)
}
}
else
{
actions create
{
echo "int main() {}... | true | true |
f77b53453ecacb3b18632b02e8e0f2e71a87c944 | 1,959 | py | Python | setup.py | shashankdeshpande/errant | 3f30ade50cec9ad20779d0e3cb8c3f27464bec65 | [
"MIT"
] | null | null | null | setup.py | shashankdeshpande/errant | 3f30ade50cec9ad20779d0e3cb8c3f27464bec65 | [
"MIT"
] | null | null | null | setup.py | shashankdeshpande/errant | 3f30ade50cec9ad20779d0e3cb8c3f27464bec65 | [
"MIT"
] | null | null | null | from pathlib import Path
from setuptools import setup, find_packages
# Get base working directory.
base_dir = Path(__file__).resolve().parent
# Readme text for long description
with open(base_dir/"README.md") as f:
readme = f.read()
setup(
name = "errant",
version = "2.2.3",
license = "MIT",
... | 40.8125 | 123 | 0.644717 | from pathlib import Path
from setuptools import setup, find_packages
base_dir = Path(__file__).resolve().parent
with open(base_dir/"README.md") as f:
readme = f.read()
setup(
name = "errant",
version = "2.2.3",
license = "MIT",
description = "The ERRor ANnotation Toolkit (ERRANT). Automatical... | true | true |
f77b534980f4fe447da45433e4e14cabcf88cc8d | 3,409 | py | Python | homeassistant/components/ness_alarm/alarm_control_panel.py | FlorianLudwig/home-assistant | 29ad3961e581d3591ce0963a7fa01672abadedf7 | [
"Apache-2.0"
] | 2 | 2017-10-26T19:43:55.000Z | 2017-12-30T23:29:00.000Z | homeassistant/components/ness_alarm/alarm_control_panel.py | FlorianLudwig/home-assistant | 29ad3961e581d3591ce0963a7fa01672abadedf7 | [
"Apache-2.0"
] | 2 | 2019-04-15T02:43:04.000Z | 2019-04-15T02:49:10.000Z | homeassistant/components/ness_alarm/alarm_control_panel.py | FlorianLudwig/home-assistant | 29ad3961e581d3591ce0963a7fa01672abadedf7 | [
"Apache-2.0"
] | 1 | 2019-06-19T07:43:11.000Z | 2019-06-19T07:43:11.000Z | """
Support for Ness D8X/D16X alarm panel.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/alarm_control_panel.ness_alarm/
"""
import logging
import homeassistant.components.alarm_control_panel as alarm
from homeassistant.const import (
STATE_ALARM_... | 31.564815 | 78 | 0.677031 |
import logging
import homeassistant.components.alarm_control_panel as alarm
from homeassistant.const import (
STATE_ALARM_ARMED_AWAY, STATE_ALARM_ARMING, STATE_ALARM_DISARMED,
STATE_ALARM_PENDING, STATE_ALARM_TRIGGERED)
from homeassistant.core import callback
from homeassistant.helpers.dispatcher import async... | true | true |
f77b53e4f452d46a3d5ef00fd68bdb02880bf0c9 | 8,749 | py | Python | Contents/Libraries/Shared/dateutil/test/_common.py | jippo015/Sub-Zero.bundle | 734e0f7128c05c0f639e11e7dfc77daa1014064b | [
"MIT"
] | 1,553 | 2015-11-09T02:17:06.000Z | 2022-03-31T20:24:52.000Z | Contents/Libraries/Shared/dateutil/test/_common.py | saiterlz/Sub-Zero.bundle | 1a0bb9c3e4be84be35d46672907783363fe5a87b | [
"MIT"
] | 691 | 2015-11-05T21:32:26.000Z | 2022-03-17T10:52:45.000Z | Contents/Libraries/Shared/dateutil/test/_common.py | saiterlz/Sub-Zero.bundle | 1a0bb9c3e4be84be35d46672907783363fe5a87b | [
"MIT"
] | 162 | 2015-11-06T19:38:55.000Z | 2022-03-16T02:42:41.000Z | from __future__ import unicode_literals
try:
import unittest2 as unittest
except ImportError:
import unittest
import os
import datetime
import time
import subprocess
import warnings
import tempfile
import pickle
class WarningTestMixin(object):
# Based on https://stackoverflow.com/a/12935176/467366
cl... | 30.273356 | 93 | 0.636644 | from __future__ import unicode_literals
try:
import unittest2 as unittest
except ImportError:
import unittest
import os
import datetime
import time
import subprocess
import warnings
import tempfile
import pickle
class WarningTestMixin(object):
class _AssertWarnsContext(warnings.catch_warnings):
... | true | true |
f77b53eca12d64174baedef5523436dba19dc706 | 23,254 | py | Python | command_line/show.py | Anthchirp/dials | 211cf7646d6711769b86643b010cb2fe5aaf71b9 | [
"BSD-3-Clause"
] | null | null | null | command_line/show.py | Anthchirp/dials | 211cf7646d6711769b86643b010cb2fe5aaf71b9 | [
"BSD-3-Clause"
] | 2 | 2020-07-31T22:37:30.000Z | 2020-07-31T23:08:55.000Z | command_line/show.py | Anthchirp/dials | 211cf7646d6711769b86643b010cb2fe5aaf71b9 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import absolute_import, division, print_function
import collections
import os
import iotbx.phil
import numpy as np
from cctbx import uctbx
from dials.array_family import flex
from dials.util import Sorry, tabulate
from dxtbx.model.experiment_list import ExperimentListFactory
from scitbx.math import fi... | 33.458993 | 93 | 0.522491 | from __future__ import absolute_import, division, print_function
import collections
import os
import iotbx.phil
import numpy as np
from cctbx import uctbx
from dials.array_family import flex
from dials.util import Sorry, tabulate
from dxtbx.model.experiment_list import ExperimentListFactory
from scitbx.math import fi... | true | true |
f77b540696d2e609f0d08dd2b9773d6d550f584e | 251 | py | Python | app/main/errors.py | ykarmouta/flask_template | 4644d3a740d0c428be8cf758685c252e18c82d37 | [
"MIT"
] | 3 | 2019-03-04T08:39:57.000Z | 2019-12-06T08:29:47.000Z | flasky/app/main/errors.py | MisterZhouZhou/python3demo | da0b6771cc12e8e1066a115c3f72a90c100108ac | [
"Apache-2.0"
] | null | null | null | flasky/app/main/errors.py | MisterZhouZhou/python3demo | da0b6771cc12e8e1066a115c3f72a90c100108ac | [
"Apache-2.0"
] | 1 | 2015-10-08T01:59:53.000Z | 2015-10-08T01:59:53.000Z | from flask import render_template
from . import main
@main.app_errorhandler(404)
def page_not_found(e):
return render_template('404.html'), 404
@main.app_errorhandler(500)
def internal_server_error(e):
return render_template('500.html'), 500 | 25.1 | 43 | 0.776892 | from flask import render_template
from . import main
@main.app_errorhandler(404)
def page_not_found(e):
return render_template('404.html'), 404
@main.app_errorhandler(500)
def internal_server_error(e):
return render_template('500.html'), 500 | true | true |
f77b54722cd625e410d674cf5ee57675f948cd79 | 7,470 | py | Python | astrogen/data/subset.py | mlares/astrogen | bfbbfee52155c09d6251455b9597fc64332989b2 | [
"MIT"
] | null | null | null | astrogen/data/subset.py | mlares/astrogen | bfbbfee52155c09d6251455b9597fc64332989b2 | [
"MIT"
] | null | null | null | astrogen/data/subset.py | mlares/astrogen | bfbbfee52155c09d6251455b9597fc64332989b2 | [
"MIT"
] | null | null | null | from pipeline import *
def make_index_html(D):# {{{
source_dir = '../../data/interim/htmls/'
for i in tqdm(D.index):
auth = D.loc[i]
papers = get_papers_from_df(auth)
df = gen_spreadsheet(auth, papers)
idx = np.argsort(df.Año.values)
df = df.loc[idx, :]
FP = np... | 32.620087 | 87 | 0.533467 | from pipeline import *
def make_index_html(D): source_dir = '../../data/interim/htmls/'
for i in tqdm(D.index):
auth = D.loc[i]
papers = get_papers_from_df(auth)
df = gen_spreadsheet(auth, papers)
idx = np.argsort(df.Año.values)
df = df.loc[idx, :]
FP = np.array... | true | true |
f77b55ddb33eaea95730ee1bdea3d6b31f8cb9c9 | 6,525 | py | Python | nsf_scraper/db/pdexcel.py | Algomorph/nsf_scraper | b709c11af17a0d9b51e4f908c3964ef6c94412fd | [
"Apache-2.0"
] | 1 | 2016-02-24T16:17:27.000Z | 2016-02-24T16:17:27.000Z | nsf_scraper/db/pdexcel.py | Algomorph/nsf_scraper | b709c11af17a0d9b51e4f908c3964ef6c94412fd | [
"Apache-2.0"
] | null | null | null | nsf_scraper/db/pdexcel.py | Algomorph/nsf_scraper | b709c11af17a0d9b51e4f908c3964ef6c94412fd | [
"Apache-2.0"
] | null | null | null | '''
@author: Greg Kramida (github id: Algomorph)
@copyright: (2015-2016) Gregory Kramida
@license: Apache V2
[That means (basically): feel free to modify, sell,
whatever, just do not remove the original author's credits/notice
from the files. For details, see LICENSE... | 39.307229 | 125 | 0.576245 | '''
@author: Greg Kramida (github id: Algomorph)
@copyright: (2015-2016) Gregory Kramida
@license: Apache V2
[That means (basically): feel free to modify, sell,
whatever, just do not remove the original author's credits/notice
from the files. For details, see LICENSE... | false | true |
f77b5611ffbd7bf8383b9712236284b5e79eefd6 | 36,596 | py | Python | test/acquisition/test_monte_carlo.py | dme65/botorch | 508f215bfe987373924e39444c8fb544d5132178 | [
"MIT"
] | null | null | null | test/acquisition/test_monte_carlo.py | dme65/botorch | 508f215bfe987373924e39444c8fb544d5132178 | [
"MIT"
] | null | null | null | test/acquisition/test_monte_carlo.py | dme65/botorch | 508f215bfe987373924e39444c8fb544d5132178 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import warnings
from unittest import mock
import torch
from botorch import settings
from botorch.acquisition.monte_car... | 47.159794 | 87 | 0.591185 |
import warnings
from unittest import mock
import torch
from botorch import settings
from botorch.acquisition.monte_carlo import (
MCAcquisitionFunction,
qExpectedImprovement,
qNoisyExpectedImprovement,
qProbabilityOfImprovement,
qSimpleRegret,
qUpperConfidenceBound,
)
from botorch.acquisition.... | true | true |
f77b5763a9d7bf13015402d85d26a5c05629b4e4 | 801 | py | Python | app/study/__init__.py | kyoungd/material-stock-finder | 021c5cf09f642b04bc9e136fb95915bda19508cd | [
"MIT"
] | null | null | null | app/study/__init__.py | kyoungd/material-stock-finder | 021c5cf09f642b04bc9e136fb95915bda19508cd | [
"MIT"
] | null | null | null | app/study/__init__.py | kyoungd/material-stock-finder | 021c5cf09f642b04bc9e136fb95915bda19508cd | [
"MIT"
] | null | null | null | from .filterLastnightGapper import LastNightGapper
from .stockFinancial import StockFinancial
from .filterRemoveNoDataStocks import RemoveNoDataStocks
from .filterAtr import FilterAtr
from .filterEma import FilterEma
from .filterKeylevels import FilterKeyLevels
from .filterFibonacciRetracement import FilterFibonacciRet... | 50.0625 | 88 | 0.893883 | from .filterLastnightGapper import LastNightGapper
from .stockFinancial import StockFinancial
from .filterRemoveNoDataStocks import RemoveNoDataStocks
from .filterAtr import FilterAtr
from .filterEma import FilterEma
from .filterKeylevels import FilterKeyLevels
from .filterFibonacciRetracement import FilterFibonacciRet... | true | true |
f77b57b111da2bb706f419c8591552ad238ef300 | 1,483 | py | Python | Data Structures/Graph Traversal/Bellman Ford Algorithm/bellmanford.py | strangestroad/interview-techdev-guide | 1d4a154dfcb6d612f658331bc76cfb17cefdd553 | [
"MIT"
] | 320 | 2019-10-02T19:59:23.000Z | 2022-03-31T12:43:15.000Z | Data Structures/Graph Traversal/Bellman Ford Algorithm/bellmanford.py | strangestroad/interview-techdev-guide | 1d4a154dfcb6d612f658331bc76cfb17cefdd553 | [
"MIT"
] | 595 | 2019-10-02T19:47:28.000Z | 2021-10-12T03:31:39.000Z | Data Structures/Graph Traversal/Bellman Ford Algorithm/bellmanford.py | strangestroad/interview-techdev-guide | 1d4a154dfcb6d612f658331bc76cfb17cefdd553 | [
"MIT"
] | 387 | 2019-10-02T19:46:29.000Z | 2022-02-04T13:41:08.000Z | '''
#######################
Implementation of Bellman Ford Algorithm in Python
Input: Weighted Directed Graph
Output: Minimum distance for each vertex from source
#######################
'''
graph = [] #dictionary to store the weighted directed graph
dist = [] # storing the minimum distance from source over eac... | 26.017544 | 72 | 0.592043 | graph = [] dist = [] def bellman_ford(src , v , e , graph):
v_copy = v
dist = [float("Inf")] * v
dist[src] = 0
for i in range(v-1):
for u , v , w in graph:
if dist[u] != float("Inf") and dist[u] + w < dist[v]:
dist[v] = dist[u] + w
for u , v , w in ... | true | true |
f77b58ef82ad2dd511cadc4150b890ac07c8a47d | 9,173 | py | Python | noahmp_ldasout2cf.py | ESMWG/noahmp-tools | 818b6d874f2981098dd3ad1ee239c88ee4743892 | [
"Apache-2.0"
] | 5 | 2019-04-04T03:14:40.000Z | 2021-07-29T03:22:11.000Z | noahmp_ldasout2cf.py | woolf1988/noahmp-tools | 818b6d874f2981098dd3ad1ee239c88ee4743892 | [
"Apache-2.0"
] | null | null | null | noahmp_ldasout2cf.py | woolf1988/noahmp-tools | 818b6d874f2981098dd3ad1ee239c88ee4743892 | [
"Apache-2.0"
] | 3 | 2019-04-04T03:14:44.000Z | 2021-12-10T07:39:17.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# convert NoahMP outputs to CF-compatible files
import sys
import os
import glob
import datetime
import argparse
import dateutil.parser
import numpy as np
import netCDF4 as nc
np.seterr(invalid='ignore')
TDIM = 'time'
TVAR = 'TIMES'
timeunits = 'hours since 1900-01-01... | 40.409692 | 140 | 0.571242 |
import sys
import os
import glob
import datetime
import argparse
import dateutil.parser
import numpy as np
import netCDF4 as nc
np.seterr(invalid='ignore')
TDIM = 'time'
TVAR = 'TIMES'
timeunits = 'hours since 1900-01-01'
XDIM = 'west_east'
XVAR = 'WEST_EAST'
YDIM = 'south_north'
YVAR = 'SOUTH_NORTH'
ACCVARS = ['A... | true | true |
f77b594a8301c56007ef1e740ebc164e63b7df7c | 6,055 | py | Python | pype/translate.py | 207leftovers/cs207project | 817b0d26490d9c6e70d932544d685af4049a83bd | [
"MIT"
] | null | null | null | pype/translate.py | 207leftovers/cs207project | 817b0d26490d9c6e70d932544d685af4049a83bd | [
"MIT"
] | null | null | null | pype/translate.py | 207leftovers/cs207project | 817b0d26490d9c6e70d932544d685af4049a83bd | [
"MIT"
] | null | null | null | from pype.ast import *
from pype.symtab import *
from pype.lib_import import LibraryImporter
from pype.fgir import FGNodeType, FGNode, Flowgraph, FGIR
from pype.error import *
class SymbolTableVisitor(ASTVisitor):
def __init__(self):
self.symbol_table = SymbolTable()
self.currentComponent = None
def retur... | 39.064516 | 113 | 0.674814 | from pype.ast import *
from pype.symtab import *
from pype.lib_import import LibraryImporter
from pype.fgir import FGNodeType, FGNode, Flowgraph, FGIR
from pype.error import *
class SymbolTableVisitor(ASTVisitor):
def __init__(self):
self.symbol_table = SymbolTable()
self.currentComponent = None
def retur... | true | true |
f77b598a6f188797a170afad66055404d3eef009 | 5,432 | py | Python | tensorflow_probability/python/experimental/mcmc/covariance_reducer_test.py | ZhiqingXiao/probability | 06a2ca643792c0cf8f047fab7971ba6784dec1c4 | [
"Apache-2.0"
] | null | null | null | tensorflow_probability/python/experimental/mcmc/covariance_reducer_test.py | ZhiqingXiao/probability | 06a2ca643792c0cf8f047fab7971ba6784dec1c4 | [
"Apache-2.0"
] | null | null | null | tensorflow_probability/python/experimental/mcmc/covariance_reducer_test.py | ZhiqingXiao/probability | 06a2ca643792c0cf8f047fab7971ba6784dec1c4 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 The TensorFlow Probability 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 o... | 37.986014 | 79 | 0.665133 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import tensorflow.compat.v2 as tf
import tensorflow_probability as tfp
from tensorflow_probability.python.internal import test_util
@test_util.test_all_tf_execution_regimes
class Covaria... | true | true |
f77b5afa4b80bedf3bf30185dc815e5110e6a44c | 2,653 | py | Python | tests/test_scrape_mensa.py | totycro/lunchbot | fd9dbf84875ec1b177739fb76cd74184241e05e9 | [
"MIT"
] | null | null | null | tests/test_scrape_mensa.py | totycro/lunchbot | fd9dbf84875ec1b177739fb76cd74184241e05e9 | [
"MIT"
] | null | null | null | tests/test_scrape_mensa.py | totycro/lunchbot | fd9dbf84875ec1b177739fb76cd74184241e05e9 | [
"MIT"
] | null | null | null | from textwrap import dedent
from typing import List, Tuple
import datetime
import requests
import pytest
from lunchbot.scrape_mensa import parse_menu, VEGY_TYPES
from lunchbot.scrape_mensa import read_page
from lunchbot.scrape_mensa import URI
def generate_test_html(
days: List[datetime.date],
items: List[... | 25.028302 | 83 | 0.586506 | from textwrap import dedent
from typing import List, Tuple
import datetime
import requests
import pytest
from lunchbot.scrape_mensa import parse_menu, VEGY_TYPES
from lunchbot.scrape_mensa import read_page
from lunchbot.scrape_mensa import URI
def generate_test_html(
days: List[datetime.date],
items: List[... | true | true |
f77b5c44c5eca6ea46c37b98e7dd84ea964be4cb | 654 | py | Python | ccdj/users/tests/test_urls.py | hernanramirez/ccdj | e5d0b396ea751a715255ddc6bf1a3987d0206766 | [
"MIT"
] | null | null | null | ccdj/users/tests/test_urls.py | hernanramirez/ccdj | e5d0b396ea751a715255ddc6bf1a3987d0206766 | [
"MIT"
] | null | null | null | ccdj/users/tests/test_urls.py | hernanramirez/ccdj | e5d0b396ea751a715255ddc6bf1a3987d0206766 | [
"MIT"
] | null | null | null | import pytest
from django.urls import resolve, reverse
from ccdj.users.models import User
pytestmark = pytest.mark.django_db
def test_detail(user: User):
assert (
reverse("users:detail", kwargs={"username": user.username})
== f"/users/{user.username}/"
)
assert resolve(f"/users/{user.use... | 26.16 | 74 | 0.674312 | import pytest
from django.urls import resolve, reverse
from ccdj.users.models import User
pytestmark = pytest.mark.django_db
def test_detail(user: User):
assert (
reverse("users:detail", kwargs={"username": user.username})
== f"/users/{user.username}/"
)
assert resolve(f"/users/{user.use... | true | true |
f77b5c46c030a8e494a55691dc85d012857cbd07 | 2,185 | py | Python | app/models/folder_node_model.py | patrickfournier/woodbox_example | 328ef5830129df7794897bafdb970b87e7eb9428 | [
"Apache-2.0"
] | null | null | null | app/models/folder_node_model.py | patrickfournier/woodbox_example | 328ef5830129df7794897bafdb970b87e7eb9428 | [
"Apache-2.0"
] | null | null | null | app/models/folder_node_model.py | patrickfournier/woodbox_example | 328ef5830129df7794897bafdb970b87e7eb9428 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
from sqlalchemy.ext.declarative import declared_attr
from woodbox.access_control.record import RecordACLModel
from woodbox.db import db, DatabaseInitializer
from woodbox.models.user_model import WBRoleModel
from woodbox.p... | 34.68254 | 101 | 0.670481 | from __future__ import absolute_import, print_function, unicode_literals
from sqlalchemy.ext.declarative import declared_attr
from woodbox.access_control.record import RecordACLModel
from woodbox.db import db, DatabaseInitializer
from woodbox.models.user_model import WBRoleModel
from woodbox.push_service import Notif... | true | true |
f77b5d4cbe95ea685fee8392b1da89139e913980 | 1,381 | py | Python | pythonProject1/pr1.py | AniruddhA-Omni/Personal-projects | bc5380874425ec5319452aaa1ea61f284a4c3b5e | [
"MIT"
] | null | null | null | pythonProject1/pr1.py | AniruddhA-Omni/Personal-projects | bc5380874425ec5319452aaa1ea61f284a4c3b5e | [
"MIT"
] | null | null | null | pythonProject1/pr1.py | AniruddhA-Omni/Personal-projects | bc5380874425ec5319452aaa1ea61f284a4c3b5e | [
"MIT"
] | null | null | null | import pandas as pd
import numpy as np
import sklearn
from sklearn import linear_model
from sklearn.utils import shuffle
import matplotlib.pyplot as py
import pickle
from matplotlib import style
data = pd.read_csv("student-mat.csv", sep=";")
#print(data.head())
data = data[["G1", "G2", "G3", "studytime", "failures", "... | 28.183673 | 100 | 0.700217 | import pandas as pd
import numpy as np
import sklearn
from sklearn import linear_model
from sklearn.utils import shuffle
import matplotlib.pyplot as py
import pickle
from matplotlib import style
data = pd.read_csv("student-mat.csv", sep=";")
data = data[["G1", "G2", "G3", "studytime", "failures", "absences"]]
predict... | true | true |
f77b5d77b916fe7214126cc21d8bfd6b03a45ee8 | 1,070 | py | Python | .venv/lib/python3.7/site-packages/jedi/inference/gradual/utils.py | ITCRStevenLPZ/Proyecto2-Analisis-de-Algoritmos | 4acdbc423428fb2e0068720add69e7870c87929a | [
"Apache-2.0"
] | 641 | 2015-01-01T11:27:21.000Z | 2022-03-22T12:46:01.000Z | Thonny/Lib/site-packages/jedi/inference/gradual/utils.py | Pydiderot/pydiderotIDE | a42fcde3ea837ae40c957469f5d87427e8ce46d3 | [
"MIT"
] | 177 | 2015-01-01T13:00:21.000Z | 2022-03-15T08:23:28.000Z | Thonny/Lib/site-packages/jedi/inference/gradual/utils.py | Pydiderot/pydiderotIDE | a42fcde3ea837ae40c957469f5d87427e8ce46d3 | [
"MIT"
] | 118 | 2015-01-14T03:03:08.000Z | 2022-03-10T03:37:40.000Z | import os
from jedi.inference.gradual.typeshed import TYPESHED_PATH, create_stub_module
def load_proper_stub_module(inference_state, file_io, import_names, module_node):
"""
This function is given a random .pyi file and should return the proper
module.
"""
path = file_io.path
assert path.ends... | 34.516129 | 90 | 0.682243 | import os
from jedi.inference.gradual.typeshed import TYPESHED_PATH, create_stub_module
def load_proper_stub_module(inference_state, file_io, import_names, module_node):
path = file_io.path
assert path.endswith('.pyi')
if path.startswith(TYPESHED_PATH):
rest = path[len(TYPESHED_PATH) + 1:... | true | true |
f77b5de12232698cf522e69b63ae0a26d6086436 | 8,403 | py | Python | basecampy3/endpoints/todolists.py | phistrom/basecampy3 | bece72d06b91de0e33afd2181c59b895dbe7ae1f | [
"MIT"
] | 29 | 2018-05-14T01:16:47.000Z | 2022-01-21T18:30:14.000Z | basecampy3/endpoints/todolists.py | phistrom/basecampy3 | bece72d06b91de0e33afd2181c59b895dbe7ae1f | [
"MIT"
] | 23 | 2018-11-03T11:14:30.000Z | 2021-09-14T02:21:37.000Z | basecampy3/endpoints/todolists.py | phistrom/basecampy3 | bece72d06b91de0e33afd2181c59b895dbe7ae1f | [
"MIT"
] | 15 | 2018-06-11T14:19:30.000Z | 2021-06-10T13:40:39.000Z | """
To-Do Lists
https://github.com/basecamp/bc3-api/blob/master/sections/todolists.md
Lists of TodoItems and TodoListGroups under a TodoSet.
The To-Do hierarchy can be confusing.
TodoSet -> TodoLists -> TodoListGroups -> TodoItems
^
You are here.
"""
import abc
import six
from . import recordi... | 44.935829 | 119 | 0.664168 |
import abc
import six
from . import recordings, todosets, util
from .. import constants
@six.add_metaclass(abc.ABCMeta)
class TodoCollection(recordings.Recording):
def list(self, status=None, completed=False):
return self._endpoint._api.todos.list(todolist=self, project=self.project_id,
... | true | true |
f77b5fa6586d56658a91816ad49b0b63ba6c9c17 | 6,883 | py | Python | src/django_mysql/models/fields/sets.py | Juh10/django-mysql | d997be1321086e2b2c46574bc7882a2737a5c43c | [
"MIT"
] | null | null | null | src/django_mysql/models/fields/sets.py | Juh10/django-mysql | d997be1321086e2b2c46574bc7882a2737a5c43c | [
"MIT"
] | null | null | null | src/django_mysql/models/fields/sets.py | Juh10/django-mysql | d997be1321086e2b2c46574bc7882a2737a5c43c | [
"MIT"
] | null | null | null | from __future__ import annotations
from typing import Any, cast
from django.core import checks
from django.db.backends.base.base import BaseDatabaseWrapper
from django.db.models import CharField, Field, IntegerField, Model, TextField
from django.db.models.expressions import BaseExpression
from django.forms import Fie... | 34.58794 | 86 | 0.567485 | from __future__ import annotations
from typing import Any, cast
from django.core import checks
from django.db.backends.base.base import BaseDatabaseWrapper
from django.db.models import CharField, Field, IntegerField, Model, TextField
from django.db.models.expressions import BaseExpression
from django.forms import Fie... | true | true |
f77b5fade831e8507ecbfcfad0ebd01e174f455f | 4,696 | py | Python | nemo/collections/nlp/models/machine_translation/mt_enc_dec_config.py | PatrykNeubauer/NeMo | 3ada744b884dba5f233f22c6991fc6092c6ca8d0 | [
"Apache-2.0"
] | 1 | 2021-09-10T10:40:51.000Z | 2021-09-10T10:40:51.000Z | nemo/collections/nlp/models/machine_translation/mt_enc_dec_config.py | PatrykNeubauer/NeMo | 3ada744b884dba5f233f22c6991fc6092c6ca8d0 | [
"Apache-2.0"
] | null | null | null | nemo/collections/nlp/models/machine_translation/mt_enc_dec_config.py | PatrykNeubauer/NeMo | 3ada744b884dba5f233f22c6991fc6092c6ca8d0 | [
"Apache-2.0"
] | 1 | 2022-01-07T03:39:11.000Z | 2022-01-07T03:39:11.000Z | # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
#
# 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 appli... | 31.945578 | 110 | 0.716141 |
from dataclasses import dataclass
from typing import Any, Optional, Tuple
from omegaconf.omegaconf import MISSING
from nemo.collections.nlp.data.machine_translation.machine_translation_dataset import TranslationDataConfig
from nemo.collections.nlp.models.enc_dec_nlp_model import EncDecNLPModelConfig
from nemo.collec... | true | true |
f77b605c1e1041dfc55d402d90473892582a77d0 | 1,190 | py | Python | callyzer_integration/migrations.py | ashish-greycube/callyzer_integration | b538fcc27d96e52d262d07fd0943f0296551d460 | [
"MIT"
] | null | null | null | callyzer_integration/migrations.py | ashish-greycube/callyzer_integration | b538fcc27d96e52d262d07fd0943f0296551d460 | [
"MIT"
] | null | null | null | callyzer_integration/migrations.py | ashish-greycube/callyzer_integration | b538fcc27d96e52d262d07fd0943f0296551d460 | [
"MIT"
] | null | null | null | import frappe
from frappe.modules.import_file import import_file_by_path
from frappe.utils import get_bench_path
import os
from os.path import join
def after_migrate(**args):
callyzer_integration_create_custom_fields(**args)
def callyzer_integration_create_custom_fields(**args):
from frappe.custom.doctype.cus... | 21.25 | 84 | 0.707563 | import frappe
from frappe.modules.import_file import import_file_by_path
from frappe.utils import get_bench_path
import os
from os.path import join
def after_migrate(**args):
callyzer_integration_create_custom_fields(**args)
def callyzer_integration_create_custom_fields(**args):
from frappe.custom.doctype.cus... | true | true |
f77b606450f3958a8074815404d01154c47f07ca | 3,255 | py | Python | wotapy_old/card/char_card_old.py | VeloceWattwing/Will-of-the-Alpha-Python | 1f94094646cd190c57b25bb58b2262cfa0657506 | [
"Apache-2.0"
] | null | null | null | wotapy_old/card/char_card_old.py | VeloceWattwing/Will-of-the-Alpha-Python | 1f94094646cd190c57b25bb58b2262cfa0657506 | [
"Apache-2.0"
] | null | null | null | wotapy_old/card/char_card_old.py | VeloceWattwing/Will-of-the-Alpha-Python | 1f94094646cd190c57b25bb58b2262cfa0657506 | [
"Apache-2.0"
] | null | null | null | import uuid as uu
from copy import copy
class CardClass:
"""
A class for the card classes
"""
def __init__(self, name, prop=[], *super):
self.name = name
self.super = super # array of superclasses
self.prop = prop
def unwrap_classes(cls: 'tuple') -> 'tuple':
"""
Return... | 27.352941 | 101 | 0.596313 | import uuid as uu
from copy import copy
class CardClass:
def __init__(self, name, prop=[], *super):
self.name = name
self.super = super self.prop = prop
def unwrap_classes(cls: 'tuple') -> 'tuple':
unwrapped = list(cls)
for x in unwrapped:
if len(x.super) > 0:
... | true | true |
f77b6195a051a555754257817c0b24c7a0d2c5da | 6,048 | py | Python | sdk/python/pulumi_azure_native/recoveryservices/v20201001/get_vault.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/recoveryservices/v20201001/get_vault.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/recoveryservices/v20201001/get_vault.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
fro... | 32.869565 | 155 | 0.623512 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
from . import outputs
__all__ = [
'GetVaultResult',
'AwaitableGetVaultResult',
'get_vault',
]
@pulumi.output_type
class GetVaultResult:
def __init__(__se... | true | true |
f77b61a72d511c7f514a7ef88b736149fc83947a | 466 | py | Python | setup.py | avlambertucci/delivery | c49b945247b0426b7cbd1b31e0854b2dd29805b2 | [
"Unlicense"
] | null | null | null | setup.py | avlambertucci/delivery | c49b945247b0426b7cbd1b31e0854b2dd29805b2 | [
"Unlicense"
] | null | null | null | setup.py | avlambertucci/delivery | c49b945247b0426b7cbd1b31e0854b2dd29805b2 | [
"Unlicense"
] | null | null | null | from setuptools import setup, find_packages
def read(filename):
return [req.strip()
for req in open(filename).readlines()
]
setup(
name="Delivery",
version="0.1.0", #major, minor, patch
description="Delivery app",
packages=find_packages(exclude="./venv"), #if a package has a __init__ is considered a p... | 25.888889 | 96 | 0.712446 | from setuptools import setup, find_packages
def read(filename):
return [req.strip()
for req in open(filename).readlines()
]
setup(
name="Delivery",
version="0.1.0", description="Delivery app",
packages=find_packages(exclude="./venv"), include_package_data=True,
install_requires=read("requirements.... | true | true |
f77b631147ee8d03d48be1c8a4f89059168c4459 | 17,391 | py | Python | tests/fastapi/test_graphql_transport_ws.py | huonw/strawberry | 8e61b2fdcf17ce99acdb8aecce9f6392c121c564 | [
"MIT"
] | null | null | null | tests/fastapi/test_graphql_transport_ws.py | huonw/strawberry | 8e61b2fdcf17ce99acdb8aecce9f6392c121c564 | [
"MIT"
] | null | null | null | tests/fastapi/test_graphql_transport_ws.py | huonw/strawberry | 8e61b2fdcf17ce99acdb8aecce9f6392c121c564 | [
"MIT"
] | null | null | null | import asyncio
import json
from datetime import timedelta
from starlette.testclient import TestClient
from starlette.websockets import WebSocketDisconnect
from strawberry.subscriptions import GRAPHQL_TRANSPORT_WS_PROTOCOL
from strawberry.subscriptions.protocols.graphql_transport_ws.types import (
CompleteMessage,... | 29.376689 | 88 | 0.57892 | import asyncio
import json
from datetime import timedelta
from starlette.testclient import TestClient
from starlette.websockets import WebSocketDisconnect
from strawberry.subscriptions import GRAPHQL_TRANSPORT_WS_PROTOCOL
from strawberry.subscriptions.protocols.graphql_transport_ws.types import (
CompleteMessage,... | true | true |
f77b631279fae1c677339aba2eb132bbd2c5b01d | 933 | py | Python | mm2.py | kapil-iitk/Arduino_bluetooth_mouse | b45bf29c24915ea39db93737bf6fb78fec55c922 | [
"MIT"
] | null | null | null | mm2.py | kapil-iitk/Arduino_bluetooth_mouse | b45bf29c24915ea39db93737bf6fb78fec55c922 | [
"MIT"
] | null | null | null | mm2.py | kapil-iitk/Arduino_bluetooth_mouse | b45bf29c24915ea39db93737bf6fb78fec55c922 | [
"MIT"
] | null | null | null | import win32api
import win32con
##from ctypes import windll
import time
import serial
##def m_move(x,y):
## windll.user32.SetCursorPos(x,y)
def l_click(x,y):
win32api.mouse_event(win32con.MOUSEEVENTF_LEFTDOWN, x, y)
time.sleep(0.05)
win32api.mouse_event(win32con.MOUSEEVENTF_LEFTUP... | 25.216216 | 67 | 0.621651 | import win32api
import win32con
import time
import serial
def l_click(x,y):
win32api.mouse_event(win32con.MOUSEEVENTF_LEFTDOWN, x, y)
time.sleep(0.05)
win32api.mouse_event(win32con.MOUSEEVENTF_LEFTUP, x, y)
def r_click(x,y):
win32api.mouse_event(win32con.MOUSEEVENTF_RIGHTDOWN,... | true | true |
f77b64ade4d3b6f664561e2a02b0628f4be945ca | 197 | py | Python | Infrastructure/app.py | Ara225/serverless-audiobook-maker | 2c390b0edd82e18eeb603d3f7e7116d83a4dc91e | [
"MIT"
] | 2 | 2020-08-09T23:26:45.000Z | 2020-10-20T07:19:32.000Z | Infrastructure/app.py | Ara225/serverless-audiobook-maker | 2c390b0edd82e18eeb603d3f7e7116d83a4dc91e | [
"MIT"
] | null | null | null | Infrastructure/app.py | Ara225/serverless-audiobook-maker | 2c390b0edd82e18eeb603d3f7e7116d83a4dc91e | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
from aws_cdk import core
from audiobook.audiobook_stack import AudiobookStack
app = core.App()
AudiobookStack(app, "audiobook", env={'region': 'eu-west-2'})
app.synth()
| 16.416667 | 61 | 0.736041 |
from aws_cdk import core
from audiobook.audiobook_stack import AudiobookStack
app = core.App()
AudiobookStack(app, "audiobook", env={'region': 'eu-west-2'})
app.synth()
| true | true |
f77b64d5ffabfb1fe78ae561619314773bb2254f | 2,353 | py | Python | tools/settings_template_readonly.py | Praveer1981/emscripten | 03863c3850ac165177a2f5c1662ad40e80980565 | [
"MIT"
] | null | null | null | tools/settings_template_readonly.py | Praveer1981/emscripten | 03863c3850ac165177a2f5c1662ad40e80980565 | [
"MIT"
] | null | null | null | tools/settings_template_readonly.py | Praveer1981/emscripten | 03863c3850ac165177a2f5c1662ad40e80980565 | [
"MIT"
] | null | null | null | # This file will be edited (the {{{ }}} things), and then ~/.emscripten created
# with the result, if ~/.emscripten doesn't exist.
# Note: If you put paths relative to the home directory, do not forget
# os.path.expanduser
# Note: On Windows, remember to escape backslashes! I.e. PYTHON='c:\Python27\'
# is not valid, ... | 39.216667 | 101 | 0.692733 |
# Note: If you put paths relative to the home directory, do not forget
# os.path.expanduser
# Note: On Windows, remember to escape backslashes! I.e. PYTHON='c:\Python27\'
# is not valid, but PYTHON='c:\\Python27\\' and PYTHON='c:/Python27/'
# are.
import os
# This is used by external projects in order to find emscr... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.