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 417k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 1
class | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f7540b9f5659d11cb2300905923e9dfe9320234b | 1,789 | py | Python | spicymeatball.py | KRHS-GameProgramming-2016/Spoonghetti-Man | 852cb278da4b04d73b58b9727bd8e3ef1982447c | [
"MIT"
] | null | null | null | spicymeatball.py | KRHS-GameProgramming-2016/Spoonghetti-Man | 852cb278da4b04d73b58b9727bd8e3ef1982447c | [
"MIT"
] | 3 | 2017-02-10T16:04:34.000Z | 2017-03-20T15:34:41.000Z | spicymeatball.py | KRHS-GameProgramming-2016/Spoonghetti-Man-v2 | 415c183e06f84e493b4f5774f32bb45aea54c83b | [
"MIT"
] | null | null | null |
import pygame, sys, math
class Ball():
def __init__(self, image, speed=[0,0], pos=[0,0], size=None):
self.image = pygame.image.load("rsc/ball/"+image)
if size:
self.image = pygame.transform.scale(self.image, [size,size])
self.rect = self.image.get_rect(center = pos)
sel... | 35.078431 | 87 | 0.543879 |
import pygame, sys, math
class Ball():
def __init__(self, image, speed=[0,0], pos=[0,0], size=None):
self.image = pygame.image.load("rsc/ball/"+image)
if size:
self.image = pygame.transform.scale(self.image, [size,size])
self.rect = self.image.get_rect(center = pos)
sel... | true | true |
f7540cbeeaf8b9779a292689f414336cd74bea26 | 153 | py | Python | ABC_B/ABC145_B.py | ryosuke0825/atcoder_python | 185cdbe7db44ecca1aaf357858d16d31ce515ddb | [
"MIT"
] | null | null | null | ABC_B/ABC145_B.py | ryosuke0825/atcoder_python | 185cdbe7db44ecca1aaf357858d16d31ce515ddb | [
"MIT"
] | null | null | null | ABC_B/ABC145_B.py | ryosuke0825/atcoder_python | 185cdbe7db44ecca1aaf357858d16d31ce515ddb | [
"MIT"
] | null | null | null | n = int(input())
s = list(input())
if n % 2 != 0:
print("No")
else:
if s[n//2:] == s[:n//2]:
print("Yes")
else:
print("No")
| 13.909091 | 28 | 0.405229 | n = int(input())
s = list(input())
if n % 2 != 0:
print("No")
else:
if s[n//2:] == s[:n//2]:
print("Yes")
else:
print("No")
| true | true |
f7540d82ebd36643222661d7668d6b4d0783cca9 | 13,958 | py | Python | gen3/tools/indexing/manifest_columns.py | andrebriggs/gen3sdk-python | f28687fe13644fd11c2c0d34a220cc5bb4796af1 | [
"Apache-2.0"
] | 2 | 2019-05-08T18:49:21.000Z | 2020-07-22T18:17:52.000Z | gen3/tools/indexing/manifest_columns.py | andrebriggs/gen3sdk-python | f28687fe13644fd11c2c0d34a220cc5bb4796af1 | [
"Apache-2.0"
] | null | null | null | gen3/tools/indexing/manifest_columns.py | andrebriggs/gen3sdk-python | f28687fe13644fd11c2c0d34a220cc5bb4796af1 | [
"Apache-2.0"
] | 1 | 2020-07-10T09:05:42.000Z | 2020-07-10T09:05:42.000Z | """
Classes to be used in the identification and validation of manifest columns
"""
import warnings
from abc import ABC
from enum import Enum, unique
import string
from urllib.parse import urlparse
from base64 import b64encode, b64decode
# Pre-defined supported column names
GUID_COLUMN_NAMES = ["guid", "GUID"]
GUID_S... | 33.552885 | 165 | 0.612624 | import warnings
from abc import ABC
from enum import Enum, unique
import string
from urllib.parse import urlparse
from base64 import b64encode, b64decode
GUID_COLUMN_NAMES = ["guid", "GUID"]
GUID_STANDARD_KEY = "guid"
FILENAME_COLUMN_NAMES = ["filename", "file_name"]
FILENAME_STANDARD_KEY = "file_name"
SIZE_COLUMN... | true | true |
f75410579908b75968a44a94d12caec109f6c1ab | 601 | py | Python | src/webmesh/message_protocols.py | BinarSkugga/webmesh | 71e66eaa86729476375b3e99a436b6b1f8de3c40 | [
"Apache-2.0"
] | 8 | 2021-07-26T04:59:46.000Z | 2021-07-30T13:11:12.000Z | src/webmesh/message_protocols.py | BinarSkugga/webmesh | 71e66eaa86729476375b3e99a436b6b1f8de3c40 | [
"Apache-2.0"
] | null | null | null | src/webmesh/message_protocols.py | BinarSkugga/webmesh | 71e66eaa86729476375b3e99a436b6b1f8de3c40 | [
"Apache-2.0"
] | null | null | null | from abc import ABC, abstractmethod
from typing import Tuple, Any, Optional
class AbstractMessageProtocol(ABC):
@abstractmethod
def unpack(self, message: Any) -> Tuple[str, Any]:
pass
@abstractmethod
def pack(self, target: Optional[str], message: Any) -> Any:
pass
class SimpleDictPr... | 28.619048 | 78 | 0.670549 | from abc import ABC, abstractmethod
from typing import Tuple, Any, Optional
class AbstractMessageProtocol(ABC):
@abstractmethod
def unpack(self, message: Any) -> Tuple[str, Any]:
pass
@abstractmethod
def pack(self, target: Optional[str], message: Any) -> Any:
pass
class SimpleDictPr... | true | true |
f75411097207ff53137a5f76627b6cbb0f746cad | 200 | py | Python | fisher.py | ttkltll/fisher | 8889705c7bde10304cfde7972b805226ac59d735 | [
"MIT"
] | null | null | null | fisher.py | ttkltll/fisher | 8889705c7bde10304cfde7972b805226ac59d735 | [
"MIT"
] | null | null | null | fisher.py | ttkltll/fisher | 8889705c7bde10304cfde7972b805226ac59d735 | [
"MIT"
] | null | null | null | from flask import current_app
from app import creat_app
app = creat_app()
if __name__ == '__main__':
app.run(debug=app.config['DEBUG'], host='0.0.0.0', port=81, threaded=True)
a = current_app | 18.181818 | 78 | 0.705 | from flask import current_app
from app import creat_app
app = creat_app()
if __name__ == '__main__':
app.run(debug=app.config['DEBUG'], host='0.0.0.0', port=81, threaded=True)
a = current_app | true | true |
f754110ed08ed92d52dc6a8bc12346902c83d7ad | 6,696 | py | Python | aggregate_CDF.py | zhangjq933/HowtoSim_Script | d958cc6cc743106e8f6ddf58dead6551a8ac7784 | [
"MIT"
] | 79 | 2019-04-01T04:35:01.000Z | 2022-03-30T10:59:32.000Z | aggregate_CDF.py | raflzhang/HowtoSim_Script | 90fb8cca87d47d2c45b8ff5d07a35e8a6c846685 | [
"MIT"
] | 1 | 2020-03-29T20:52:06.000Z | 2020-03-30T05:35:30.000Z | aggregate_CDF.py | raflzhang/HowtoSim_Script | 90fb8cca87d47d2c45b8ff5d07a35e8a6c846685 | [
"MIT"
] | 73 | 2019-05-07T10:26:53.000Z | 2022-03-24T02:25:08.000Z | # -*- coding: utf-8 -*-
"""
Created on Fri Oct 19 19:24:49 2019
@author: mlin
"""
import matplotlib.pyplot as plt
from collections import OrderedDict
import numpy as np
import copy
class ffd():
def __init__(self, ffd_file, incident_Power_W=1):
self.incident_Power_W=incident_Power_W
... | 32.504854 | 103 | 0.559737 |
import matplotlib.pyplot as plt
from collections import OrderedDict
import numpy as np
import copy
class ffd():
def __init__(self, ffd_file, incident_Power_W=1):
self.incident_Power_W=incident_Power_W
with open(ffd_file) as f:
self.theta=[int(i) for i in f.readli... | true | true |
f7541112a8d11120bd9bab491c4232da49e3929f | 284 | py | Python | apple/apple/items.py | macchiang/practice-code-on-big-data | e5d06e637b1c4c427b62e2eccf317c12ba0ffe37 | [
"MIT"
] | null | null | null | apple/apple/items.py | macchiang/practice-code-on-big-data | e5d06e637b1c4c427b62e2eccf317c12ba0ffe37 | [
"MIT"
] | null | null | null | apple/apple/items.py | macchiang/practice-code-on-big-data | e5d06e637b1c4c427b62e2eccf317c12ba0ffe37 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Define here the models for your scraped items
#
# See documentation in:
# http://doc.scrapy.org/en/latest/topics/items.html
import scrapy
class AppleItem(scrapy.Item):
# define the fields for your item here like:
# name = scrapy.Field()
pass
| 18.933333 | 51 | 0.683099 |
import scrapy
class AppleItem(scrapy.Item):
pass
| true | true |
f75411bc02545dbb0e19e694f8757de9d13ae686 | 2,307 | py | Python | setup.py | juforg/flask-api-sign | 90ab5bb4b70175ace5fe101fa89cbde92511ec34 | [
"MIT"
] | null | null | null | setup.py | juforg/flask-api-sign | 90ab5bb4b70175ace5fe101fa89cbde92511ec34 | [
"MIT"
] | null | null | null | setup.py | juforg/flask-api-sign | 90ab5bb4b70175ace5fe101fa89cbde92511ec34 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Flask Api Sign Verification
-------------
Flask extension of Api Sign Verification.
"""
from setuptools import setup
with open('README.rst') as readme_file:
readme = readme_file.read()
with open('HISTORY.rst') as history_file:
history = history_file.read(... | 29.961039 | 80 | 0.606415 |
from setuptools import setup
with open('README.rst') as readme_file:
readme = readme_file.read()
with open('HISTORY.rst') as history_file:
history = history_file.read()
requirements = [
'Click>=6.0',
'Flask>=1.0',
]
test_requirements = [
]
setup(
name='flask_api_sign',
version='... | true | true |
f75411f406308e9e785812ec9b97e78f8a583c81 | 30,718 | py | Python | mint/wallet/cc_wallet/cc_wallet.py | MintNetwork/mint-blockchain | 65ec05a015a07664ed25f83efa736065a17f7d7a | [
"Apache-2.0"
] | 12 | 2021-08-18T20:53:31.000Z | 2022-03-15T21:45:13.000Z | mint/wallet/cc_wallet/cc_wallet.py | MintNetwork/mint-blockchain | 65ec05a015a07664ed25f83efa736065a17f7d7a | [
"Apache-2.0"
] | 34 | 2021-08-18T19:12:11.000Z | 2022-01-06T17:15:34.000Z | mint/wallet/cc_wallet/cc_wallet.py | MintNetwork/mint-blockchain | 65ec05a015a07664ed25f83efa736065a17f7d7a | [
"Apache-2.0"
] | 7 | 2021-08-18T20:53:34.000Z | 2022-03-15T08:37:40.000Z | from __future__ import annotations
import logging
import time
from dataclasses import replace
from secrets import token_bytes
from typing import Any, Dict, List, Optional, Set
from blspy import AugSchemeMPL, G2Element
from mint.consensus.cost_calculator import calculate_cost_of_program, NPCResult
from mint.full_node... | 40.740053 | 118 | 0.648219 | from __future__ import annotations
import logging
import time
from dataclasses import replace
from secrets import token_bytes
from typing import Any, Dict, List, Optional, Set
from blspy import AugSchemeMPL, G2Element
from mint.consensus.cost_calculator import calculate_cost_of_program, NPCResult
from mint.full_node... | true | true |
f7541356b8f93558c9d9a11a985e8568e0465886 | 2,089 | py | Python | wamukap/common/kafka_util.py | rhafer/wamukap | 7d1ae3ab3823841a605ee5055a5b3ec2c4ce0080 | [
"Apache-2.0"
] | null | null | null | wamukap/common/kafka_util.py | rhafer/wamukap | 7d1ae3ab3823841a605ee5055a5b3ec2c4ce0080 | [
"Apache-2.0"
] | null | null | null | wamukap/common/kafka_util.py | rhafer/wamukap | 7d1ae3ab3823841a605ee5055a5b3ec2c4ce0080 | [
"Apache-2.0"
] | null | null | null | # (c) Copyright 2021, Ralf Haferkamp <ralf@h4kamp.de>
#
# 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 ... | 33.15873 | 79 | 0.681666 |
from aiokafka import AIOKafkaProducer, AIOKafkaConsumer
from aiokafka.helpers import create_ssl_context
import kafka
async def get_producer(kafka_cfg, logger):
logger.debug("Creating Kafka producer for {}".format(kafka_cfg['servers']))
producer = None
context = create_ssl_context(
ca... | true | true |
f754148c59ab7549ea1cf12efe483edc86e53c34 | 11,393 | py | Python | Radiomics/Radiomics MPE images.py | akac0297/PETLAB | 950cc153ce230d12d752ad0d11111e7fc22d9e7d | [
"MIT"
] | null | null | null | Radiomics/Radiomics MPE images.py | akac0297/PETLAB | 950cc153ce230d12d752ad0d11111e7fc22d9e7d | [
"MIT"
] | null | null | null | Radiomics/Radiomics MPE images.py | akac0297/PETLAB | 950cc153ce230d12d752ad0d11111e7fc22d9e7d | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
import SimpleITK as sitk
import pandas as pd
import numpy as np
import radiomics
def radiomics_analysis(image_filepath, mask_filepath,img_label):
img = sitk.ReadImage(image_filepath)
mask = sitk.ReadImage(mask_filepath)
#Z-score normalisation for MRI
if img_l... | 63.648045 | 1,760 | 0.756166 |
import SimpleITK as sitk
import pandas as pd
import numpy as np
import radiomics
def radiomics_analysis(image_filepath, mask_filepath,img_label):
img = sitk.ReadImage(image_filepath)
mask = sitk.ReadImage(mask_filepath)
if img_label==("B50T_CAD_ADC_3000" or "B50_800 ADC" or "MPE"):
z_n... | true | true |
f75414ee15dfe0b26a8f8dd72e9b0e4721b0f317 | 10,904 | py | Python | pyeccodes/defs/grib2/tables/6/4_2_0_1_table.py | ecmwf/pyeccodes | dce2c72d3adcc0cb801731366be53327ce13a00b | [
"Apache-2.0"
] | 7 | 2020-04-14T09:41:17.000Z | 2021-08-06T09:38:19.000Z | pyeccodes/defs/grib2/tables/6/4_2_0_1_table.py | ecmwf/pyeccodes | dce2c72d3adcc0cb801731366be53327ce13a00b | [
"Apache-2.0"
] | null | null | null | pyeccodes/defs/grib2/tables/6/4_2_0_1_table.py | ecmwf/pyeccodes | dce2c72d3adcc0cb801731366be53327ce13a00b | [
"Apache-2.0"
] | 3 | 2020-04-30T12:44:48.000Z | 2020-12-15T08:40:26.000Z | def load(h):
return ({'abbr': 0, 'code': 0, 'title': 'Specific humidity', 'units': 'kg kg-1'},
{'abbr': 1, 'code': 1, 'title': 'Relative humidity', 'units': '%'},
{'abbr': 2, 'code': 2, 'title': 'Humidity mixing ratio', 'units': 'kg kg-1'},
{'abbr': 3, 'code': 3, 'title': 'Precip... | 40.992481 | 91 | 0.406731 | def load(h):
return ({'abbr': 0, 'code': 0, 'title': 'Specific humidity', 'units': 'kg kg-1'},
{'abbr': 1, 'code': 1, 'title': 'Relative humidity', 'units': '%'},
{'abbr': 2, 'code': 2, 'title': 'Humidity mixing ratio', 'units': 'kg kg-1'},
{'abbr': 3, 'code': 3, 'title': 'Precip... | true | true |
f75415406ef60d7516b8f73ca33fe5d08f683da8 | 9,772 | py | Python | data_cube_wcs/utils.py | ceos-seo/django-datacube-wcs | 250742947036763a95b19bdf132b2270d9bb5be9 | [
"Apache-2.0"
] | 7 | 2017-10-18T10:00:41.000Z | 2019-05-22T10:01:19.000Z | data_cube_wcs/utils.py | ceos-seo/django-datacube-wcs | 250742947036763a95b19bdf132b2270d9bb5be9 | [
"Apache-2.0"
] | null | null | null | data_cube_wcs/utils.py | ceos-seo/django-datacube-wcs | 250742947036763a95b19bdf132b2270d9bb5be9 | [
"Apache-2.0"
] | 4 | 2017-10-13T15:11:51.000Z | 2019-11-27T21:41:03.000Z | from django.apps import apps
from datetime import datetime, date, timedelta
from django.conf import settings
import xarray as xr
import numpy as np
import collections
from rasterio.io import MemoryFile
from datacube.config import LocalConfig
import datacube
import configparser
def form_to_data_cube_parameters(form_... | 38.472441 | 120 | 0.64255 | from django.apps import apps
from datetime import datetime, date, timedelta
from django.conf import settings
import xarray as xr
import numpy as np
import collections
from rasterio.io import MemoryFile
from datacube.config import LocalConfig
import datacube
import configparser
def form_to_data_cube_parameters(form_... | true | true |
f7541573696b2904ec9be42f9bc44295807898f5 | 2,711 | py | Python | test/connections/mongoconnection_test.py | deeso/service-utilities | 9a3ebdcad9a1d0049a23e3486d7ea99a6d08f81a | [
"Apache-2.0"
] | null | null | null | test/connections/mongoconnection_test.py | deeso/service-utilities | 9a3ebdcad9a1d0049a23e3486d7ea99a6d08f81a | [
"Apache-2.0"
] | null | null | null | test/connections/mongoconnection_test.py | deeso/service-utilities | 9a3ebdcad9a1d0049a23e3486d7ea99a6d08f81a | [
"Apache-2.0"
] | null | null | null | # import docker
from service.utilities.connection import ConnectionFactory, MongoConnection
import unittest
from unittest import TestCase
import toml
EXAMPLE_TOML = '''
uri = 'mongodb://127.0.0.1:27017'
name = "testing"
default_dbname = 'mydefault'
default_colname = 'mydefault_col'
id_key = 'msg2_id'
'''
class Te... | 32.27381 | 75 | 0.627444 |
from service.utilities.connection import ConnectionFactory, MongoConnection
import unittest
from unittest import TestCase
import toml
EXAMPLE_TOML = '''
uri = 'mongodb://127.0.0.1:27017'
name = "testing"
default_dbname = 'mydefault'
default_colname = 'mydefault_col'
id_key = 'msg2_id'
'''
class TestMongoClientCo... | true | true |
f75415e2a7cf2a95c0ca2b3df1829b419c3f300c | 589 | py | Python | beehive/service/bee_hive_service.py | BartekStok/beehive-apiary-sim | b4c3b8ca079710cd3eeb315eedd752384cf2166d | [
"MIT"
] | 1 | 2020-03-21T21:52:37.000Z | 2020-03-21T21:52:37.000Z | beehive/service/bee_hive_service.py | BartekStok/beehive-apiary-sim | b4c3b8ca079710cd3eeb315eedd752384cf2166d | [
"MIT"
] | 1 | 2020-03-14T07:03:26.000Z | 2020-03-14T07:03:26.000Z | beehive/service/bee_hive_service.py | BartekStok/beehive-apiary-sim | b4c3b8ca079710cd3eeb315eedd752384cf2166d | [
"MIT"
] | null | null | null | from django.utils import timezone
from beehive.models import BeeHive
class BeeHiveService():
"""Sets service date for BeeHive"""
@staticmethod
def set_beehive_service_date(beehive_id):
beehive = BeeHive.objects.get(id=beehive_id)
beehive.service_date = timezone.now()
beehive.save... | 24.541667 | 52 | 0.677419 | from django.utils import timezone
from beehive.models import BeeHive
class BeeHiveService():
@staticmethod
def set_beehive_service_date(beehive_id):
beehive = BeeHive.objects.get(id=beehive_id)
beehive.service_date = timezone.now()
beehive.save()
return beehive
@staticm... | true | true |
f7541601dfc6867c5be243f4d0b0cc8c2b217a8c | 12,729 | py | Python | tests/gpflow/posteriors/test_bo_integration.py | uri-granta/GPflow | 94b432847cb82c7627a57987f5c5ddd7fc400414 | [
"Apache-2.0"
] | null | null | null | tests/gpflow/posteriors/test_bo_integration.py | uri-granta/GPflow | 94b432847cb82c7627a57987f5c5ddd7fc400414 | [
"Apache-2.0"
] | null | null | null | tests/gpflow/posteriors/test_bo_integration.py | uri-granta/GPflow | 94b432847cb82c7627a57987f5c5ddd7fc400414 | [
"Apache-2.0"
] | null | null | null | # Copyright 2022 The GPflow Contributors. 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 appl... | 31.507426 | 100 | 0.698719 |
from typing import Any, Callable, DefaultDict, Dict, Iterator, Mapping, Set, Tuple, Type, TypeVar
import numpy as np
import pytest
import tensorflow as tf
from _pytest.fixtures import SubRequest
import gpflow
from gpflow.base import RegressionData
from gpflow.config import default_float
from gpflow.induc... | true | true |
f75416c94f2a6d9b2c4e9486c49c66266db56a19 | 634 | py | Python | apps/bills/migrations/0004_auto_20190219_0757.py | sonnhfit/supermarket | 9b455c1354007cccb6cec40c04008c72bd4d7316 | [
"MIT"
] | null | null | null | apps/bills/migrations/0004_auto_20190219_0757.py | sonnhfit/supermarket | 9b455c1354007cccb6cec40c04008c72bd4d7316 | [
"MIT"
] | null | null | null | apps/bills/migrations/0004_auto_20190219_0757.py | sonnhfit/supermarket | 9b455c1354007cccb6cec40c04008c72bd4d7316 | [
"MIT"
] | null | null | null | # Generated by Django 2.1.4 on 2019-02-19 07:57
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('bills', '0003_auto_20190219_0709'),
]
operations = [
migrations.RemoveField(
model_name='bills'... | 26.416667 | 160 | 0.619874 |
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('bills', '0003_auto_20190219_0709'),
]
operations = [
migrations.RemoveField(
model_name='bills',
name='bill_detail',
),
... | true | true |
f754171c57619c2a07ff4c8ab9e12ce2e217e068 | 495 | py | Python | taskana_api/entities/users.py | aK0nshin/taskana-api | eb511617d501aec0d07f83bc10f4159f09535d5b | [
"MIT"
] | null | null | null | taskana_api/entities/users.py | aK0nshin/taskana-api | eb511617d501aec0d07f83bc10f4159f09535d5b | [
"MIT"
] | null | null | null | taskana_api/entities/users.py | aK0nshin/taskana-api | eb511617d501aec0d07f83bc10f4159f09535d5b | [
"MIT"
] | null | null | null | # from datetime import datetime
# from typing import Optional
#
# from fastapi_users import models
# from sqlmodel import SQLModel
#
#
# class UserBase(models.BaseUser, SQLModel):
# first_name: str
# birthdate: Optional[datetime.date]
#
#
# class UserCreate(models.BaseUserCreate, SQLModel):
# first_name: st... | 22.5 | 52 | 0.727273 | true | true | |
f7541848daf36f22924dcb4499e5119c6f9ad3e0 | 14,750 | py | Python | odin/ml/plda.py | tirkarthi/odin-ai | 7900bef82ad8801d0c73880330d5b24d9ff7cd06 | [
"MIT"
] | 7 | 2020-12-29T19:35:58.000Z | 2022-01-31T21:01:30.000Z | odin/ml/plda.py | tirkarthi/odin-ai | 7900bef82ad8801d0c73880330d5b24d9ff7cd06 | [
"MIT"
] | 3 | 2020-02-06T16:44:17.000Z | 2020-09-26T05:26:14.000Z | odin/ml/plda.py | tirkarthi/odin-ai | 7900bef82ad8801d0c73880330d5b24d9ff7cd06 | [
"MIT"
] | 6 | 2019-02-14T01:36:28.000Z | 2020-10-30T13:16:32.000Z | # -*- coding: utf-8 -*-
""""
author: 'Omid Sadjadi, Timothee Kheyrkhah'
email: 'omid.sadjadi@nist.gov'
"""
import time
import warnings
from numbers import Number
import numpy as np
from scipy.linalg import cholesky, eigh, inv, solve, svd
from six import string_types
from odin.backend import calc_white_mat, length_nor... | 34.787736 | 92 | 0.609288 |
import time
import warnings
from numbers import Number
import numpy as np
from scipy.linalg import cholesky, eigh, inv, solve, svd
from six import string_types
from odin.backend import calc_white_mat, length_norm
from odin.ml.base import BaseEstimator, Evaluable, TransformerMixin
from odin.ml.scoring import (VectorN... | true | true |
f7541991f36ff68d8bba5c6f7185e51e3901f4b4 | 65,080 | py | Python | TweakApi/apis/template_permission_set_api.py | tweak-com-public/tweak-api-client-python | 019f86da11fdb12683d516f8f37db5d717380bcc | [
"Apache-2.0"
] | null | null | null | TweakApi/apis/template_permission_set_api.py | tweak-com-public/tweak-api-client-python | 019f86da11fdb12683d516f8f37db5d717380bcc | [
"Apache-2.0"
] | null | null | null | TweakApi/apis/template_permission_set_api.py | tweak-com-public/tweak-api-client-python | 019f86da11fdb12683d516f8f37db5d717380bcc | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
tweak-api
Tweak API to integrate with all the Tweak services. You can find out more about Tweak at <a href='https://www.tweak.com'>https://www.tweak.com</a>, #tweak.
OpenAPI spec version: 1.0.8-beta.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
... | 41.531589 | 165 | 0.573141 |
from __future__ import absolute_import
import sys
import os
import re
from six import iteritems
from ..configuration import Configuration
from ..api_client import ApiClient
class TemplatePermissionSetApi(object):
def __init__(self, api_client=None):
config = Configuration()
if api_client:
... | true | true |
f75419c52f66e6ab2777422349398878fb237b39 | 11,402 | py | Python | catbird/core/optimizer/default_constructor.py | AfonsoSalgadoSousa/catbird | e285613f6e101115cccc1f88bbcf0cd435fbd4e9 | [
"MIT"
] | 5 | 2021-12-25T23:26:00.000Z | 2022-03-26T09:13:41.000Z | catbird/core/optimizer/default_constructor.py | AfonsoSalgadoSousa/catbird | e285613f6e101115cccc1f88bbcf0cd435fbd4e9 | [
"MIT"
] | null | null | null | catbird/core/optimizer/default_constructor.py | AfonsoSalgadoSousa/catbird | e285613f6e101115cccc1f88bbcf0cd435fbd4e9 | [
"MIT"
] | null | null | null | import warnings
import torch
from torch.nn import GroupNorm, LayerNorm
from torch.nn.modules.batchnorm import _BatchNorm
from torch.nn.modules.instancenorm import _InstanceNorm
from ..utils import build_from_cfg
from .builder import OPTIMIZER_BUILDERS, OPTIMIZERS
@OPTIMIZER_BUILDERS.register_module
class DefaultOpt... | 47.907563 | 87 | 0.617172 | import warnings
import torch
from torch.nn import GroupNorm, LayerNorm
from torch.nn.modules.batchnorm import _BatchNorm
from torch.nn.modules.instancenorm import _InstanceNorm
from ..utils import build_from_cfg
from .builder import OPTIMIZER_BUILDERS, OPTIMIZERS
@OPTIMIZER_BUILDERS.register_module
class DefaultOpt... | true | true |
f7541a9caea7fc2fbbf984045a54fe47eef4da3e | 480 | py | Python | Encoplot+Greedy/plagiarism.py | ML-UCV/Combining-Encoplot-and-Based-Deep-Learning-for-Plagiarism-Detection | 3c8bdddeac1e462635f6b23b5fbf8aca71184770 | [
"MIT"
] | null | null | null | Encoplot+Greedy/plagiarism.py | ML-UCV/Combining-Encoplot-and-Based-Deep-Learning-for-Plagiarism-Detection | 3c8bdddeac1e462635f6b23b5fbf8aca71184770 | [
"MIT"
] | null | null | null | Encoplot+Greedy/plagiarism.py | ML-UCV/Combining-Encoplot-and-Based-Deep-Learning-for-Plagiarism-Detection | 3c8bdddeac1e462635f6b23b5fbf8aca71184770 | [
"MIT"
] | null | null | null | """# Plagiarism Class - for document known plagiarism list - used for later evaluation
Members:
- this_offset
- this_length
- source_offset
- source_length
"""
class Plagiarism():
def __init__(self, this_offset, this_length, source_reference, source_offset, source_length):
self.this_offset = this_offset... | 30 | 95 | 0.758333 |
class Plagiarism():
def __init__(self, this_offset, this_length, source_reference, source_offset, source_length):
self.this_offset = this_offset
self.this_length = this_length
self.source_reference = source_reference
self.source_offset = source_offset
self.source_length = source_length | true | true |
f7541af445e01bc99a555c1a89c9023f3a9db5cf | 565 | py | Python | scripts/db-cleanup.py | willith/RPi-central-heating-controller | 3a8cc08c8a748c191f9713b52a47e7451596a1a7 | [
"MIT"
] | null | null | null | scripts/db-cleanup.py | willith/RPi-central-heating-controller | 3a8cc08c8a748c191f9713b52a47e7451596a1a7 | [
"MIT"
] | null | null | null | scripts/db-cleanup.py | willith/RPi-central-heating-controller | 3a8cc08c8a748c191f9713b52a47e7451596a1a7 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
from shutil import copyfile
import sqlite3
from datetime import datetime, date
import dateutil.relativedelta
now = date.today()
date2 = now + dateutil.relativedelta.relativedelta(months=-1)
copyfile("/home/pi/database/centralheating.db", "/home/pi/database/archive/centralheating-%s.db" % date2)
c... | 26.904762 | 132 | 0.743363 |
from shutil import copyfile
import sqlite3
from datetime import datetime, date
import dateutil.relativedelta
now = date.today()
date2 = now + dateutil.relativedelta.relativedelta(months=-1)
copyfile("/home/pi/database/centralheating.db", "/home/pi/database/archive/centralheating-%s.db" % date2)
conn=sqlite3.connect('... | true | true |
f7541b624539c842fdcf009857033324a6d52760 | 473 | py | Python | setup.py | ehanson8/dspace-api-python-scripts | 0e51944e0bd4e009d11891dbafae82aa21801e35 | [
"Apache-2.0"
] | 9 | 2019-07-16T11:05:38.000Z | 2021-10-13T01:38:19.000Z | setup.py | ehanson8/dspace-api-python-scripts | 0e51944e0bd4e009d11891dbafae82aa21801e35 | [
"Apache-2.0"
] | 7 | 2019-05-02T17:51:39.000Z | 2020-03-02T16:34:49.000Z | setup.py | ehanson8/dspace-api-python-scripts | 0e51944e0bd4e009d11891dbafae82aa21801e35 | [
"Apache-2.0"
] | 1 | 2020-04-10T10:30:29.000Z | 2020-04-10T10:30:29.000Z | from setuptools import setup, find_packages
setup(
name="dsaps",
version="1.0.0",
description="",
packages=find_packages(exclude=["tests"]),
author="Eric Hanson",
author_email="ehanson@mit.edu",
install_requires=[
"requests",
"structlog",
"attrs",
"click",
... | 19.708333 | 46 | 0.539112 | from setuptools import setup, find_packages
setup(
name="dsaps",
version="1.0.0",
description="",
packages=find_packages(exclude=["tests"]),
author="Eric Hanson",
author_email="ehanson@mit.edu",
install_requires=[
"requests",
"structlog",
"attrs",
"click",
... | true | true |
f7541bd3e0eb570effbed79b595d2d83b57d318c | 4,397 | py | Python | processing/pcap.py | vnc0d9r/openMA | 6554515c32bbd5798cda57f5f648a5f5382a4abf | [
"Apache-2.0"
] | null | null | null | processing/pcap.py | vnc0d9r/openMA | 6554515c32bbd5798cda57f5f648a5f5382a4abf | [
"Apache-2.0"
] | null | null | null | processing/pcap.py | vnc0d9r/openMA | 6554515c32bbd5798cda57f5f648a5f5382a4abf | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# Cuckoo Sandbox - Automated Malware Analysis
# Copyright (C) 2010-2011 Claudio "nex" Guarnieri (nex@cuckoobox.org)
# http://www.cuckoobox.org
#
# This file is part of Cuckoo.
#
# Cuckoo is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as ... | 29.709459 | 72 | 0.51103 |
import os
import re
import sys
import socket
try:
import dpkt
except ImportError:
sys.exit(1)
class Pcap:
def __init__(self, filepath):
self.filepath = filepath
self.tcp_connections = []
self.udp_connections = []
self.http_requests = []
self.dns_... | true | true |
f7541c0e892819beaf27ad97d7d41b8f963a4ab9 | 1,818 | py | Python | tensorflow/python/ops/nn_grad_test.py | ryorda/tensorflow-viennacl | 054b515feec0a3fca4cfb1f29adbf423c9027c3a | [
"Apache-2.0"
] | 522 | 2016-06-08T02:15:50.000Z | 2022-03-02T05:30:36.000Z | tensorflow/python/ops/nn_grad_test.py | hamzabekkouri/tensorflow | d87a9fbbc5f49ec5ae8eb52c62628f0b1a0bf67f | [
"Apache-2.0"
] | 48 | 2016-07-26T00:11:55.000Z | 2022-02-23T13:36:33.000Z | tensorflow/python/ops/nn_grad_test.py | hamzabekkouri/tensorflow | d87a9fbbc5f49ec5ae8eb52c62628f0b1a0bf67f | [
"Apache-2.0"
] | 108 | 2016-06-16T15:34:05.000Z | 2022-03-12T13:23:11.000Z | # Copyright 2016 The TensorFlow Authors. 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 applica... | 37.102041 | 80 | 0.69857 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from tensorflow.python.framework import constant_op
from tensorflow.python.framework import dtypes
from tensorflow.python.ops import gradient_checker
from tensorflow.python.op... | true | true |
f7541c52eca7275c899e00821795d60ff04b5c34 | 233 | py | Python | setka/pipes/GarbageCollector.py | SlinkoIgor/setka | 70e9bda226ca924be9ba0a83e3f7aeff7884698c | [
"MIT"
] | null | null | null | setka/pipes/GarbageCollector.py | SlinkoIgor/setka | 70e9bda226ca924be9ba0a83e3f7aeff7884698c | [
"MIT"
] | null | null | null | setka/pipes/GarbageCollector.py | SlinkoIgor/setka | 70e9bda226ca924be9ba0a83e3f7aeff7884698c | [
"MIT"
] | null | null | null | from .Pipe import Pipe
import gc
class GarbageCollector(Pipe):
'''
Probably should be merged with the Dataset handler (?).
'''
def __init__(self):
gc.enable()
def after_epoch(self):
gc.collect() | 17.923077 | 59 | 0.618026 | from .Pipe import Pipe
import gc
class GarbageCollector(Pipe):
def __init__(self):
gc.enable()
def after_epoch(self):
gc.collect() | true | true |
f7541d3b1549e5d5d32e62014509e280da930637 | 5,422 | py | Python | docs/conf.py | ishiland/nyc-geoclient | 1bd7aaf3d9ee09d9cb87c43cefdaedd99b5bc731 | [
"BSD-3-Clause"
] | 1 | 2019-11-21T23:11:28.000Z | 2019-11-21T23:11:28.000Z | docs/conf.py | ishiland/nyc-geoclient | 1bd7aaf3d9ee09d9cb87c43cefdaedd99b5bc731 | [
"BSD-3-Clause"
] | null | null | null | docs/conf.py | ishiland/nyc-geoclient | 1bd7aaf3d9ee09d9cb87c43cefdaedd99b5bc731 | [
"BSD-3-Clause"
] | 1 | 2022-01-19T18:37:11.000Z | 2022-01-19T18:37:11.000Z | # -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
#
# This file does only contain a selection of the most common options. For a
# full list see the documentation:
# http://www.sphinx-doc.org/en/master/config
# -- Path setup ------------------------------------------------------------... | 29.955801 | 79 | 0.654924 |
import os
import sys
sys.path.insert(0, os.path.abspath('..'))
from geoclient.config import __version__, __author__
project = 'python-geoclient'
copyright = '2019, Ian Shiland'
author = __author__
version = __version__
release = __version__
extensions = [
'sphinx.ext.autodoc',
'... | true | true |
f7541d67f3b115837313260eda555dcff3dbd76a | 6,168 | py | Python | rl_coach/rl_deepracer_coach_robomaker.py | jarrettj/deepracer | 2c9d083b2b0c8b3b3ac1468d154d7d7ebfb17961 | [
"Apache-2.0"
] | null | null | null | rl_coach/rl_deepracer_coach_robomaker.py | jarrettj/deepracer | 2c9d083b2b0c8b3b3ac1468d154d7d7ebfb17961 | [
"Apache-2.0"
] | null | null | null | rl_coach/rl_deepracer_coach_robomaker.py | jarrettj/deepracer | 2c9d083b2b0c8b3b3ac1468d154d7d7ebfb17961 | [
"Apache-2.0"
] | 1 | 2021-09-17T18:40:53.000Z | 2021-09-17T18:40:53.000Z | #!/usr/bin/env python
# coding: utf-8
import sagemaker
import boto3
import sys
import os
import glob
import re
import subprocess
from IPython.display import Markdown
from time import gmtime, strftime
sys.path.append("common")
from misc import get_execution_role, wait_for_s3_object
from sagemaker.rl import RLEstimator... | 46.727273 | 207 | 0.626946 |
import sagemaker
import boto3
import sys
import os
import glob
import re
import subprocess
from IPython.display import Markdown
from time import gmtime, strftime
sys.path.append("common")
from misc import get_execution_role, wait_for_s3_object
from sagemaker.rl import RLEstimator, RLToolkit, RLFramework
from markdo... | true | true |
f7541dccc7f828d5420d85d25341eedd35b1e6c6 | 1,984 | py | Python | src/universe-driving/drive.py | arminnh/deep-q-learning | e6ec12cfa2468b86f60a6cb2635f5feb12dcd7a6 | [
"MIT"
] | 1 | 2017-12-07T02:18:17.000Z | 2017-12-07T02:18:17.000Z | src/universe-driving/drive.py | arminnh/deep-q-learning | e6ec12cfa2468b86f60a6cb2635f5feb12dcd7a6 | [
"MIT"
] | null | null | null | src/universe-driving/drive.py | arminnh/deep-q-learning | e6ec12cfa2468b86f60a6cb2635f5feb12dcd7a6 | [
"MIT"
] | null | null | null | #https://github.com/openai/universe-starter-agent/blob/master/envs.py
import gym
import universe
import socketio
import eventlet.wsgi
from PIL import Image
from flask import Flask
from io import BytesIO
from TORCH_DQN import DQN
from enum import Enum
import torchvision.transforms as T
import ast
import torch
from env ... | 25.113924 | 83 | 0.611391 |
import gym
import universe
import socketio
import eventlet.wsgi
from PIL import Image
from flask import Flask
from io import BytesIO
from TORCH_DQN import DQN
from enum import Enum
import torchvision.transforms as T
import ast
import torch
from env import create_flash_env
class Moves(Enum):
LEFT = 0
RIGHT = ... | true | true |
f7541edfa8635da5971bc31e3241e7de26570977 | 3,192 | py | Python | Python/rmn.py | cga101/Retail-Me-Not-Contest | 7980a0d0f9614df9f750ec15c057c46cd33f8d80 | [
"MIT"
] | null | null | null | Python/rmn.py | cga101/Retail-Me-Not-Contest | 7980a0d0f9614df9f750ec15c057c46cd33f8d80 | [
"MIT"
] | null | null | null | Python/rmn.py | cga101/Retail-Me-Not-Contest | 7980a0d0f9614df9f750ec15c057c46cd33f8d80 | [
"MIT"
] | null | null | null | #imports (non-3rd Party)
import re
import csv
import operator
from math import sqrt
from collections import defaultdict, Counter
#Data Structures
##Hashtables for Operations
hashMerchant = defaultdict(list)
hashStore = defaultdict(list)
hashVisitors = defaultdict(list)
minA = Counter()
maxA = Counter()
#Question 1 ... | 27.050847 | 202 | 0.664474 |
import re
import csv
import operator
from math import sqrt
from collections import defaultdict, Counter
t(list)
hashStore = defaultdict(list)
hashVisitors = defaultdict(list)
minA = Counter()
maxA = Counter()
ks += 1
return clicks
def getMax(x):
maxA.clear()
for i in x:
maxA[i] += 1
val = list(maxA.values... | true | true |
f754211c39dc80d6f1c4348cf88943845734f8d1 | 7,271 | py | Python | experiments/mario/gym-nes-mario-bros-master/src/run-mario.py | selfemergence/NEAT-multiprocessing | 3dc57c6ec18658253398ae0b361b72f78e3fd0c9 | [
"MIT"
] | 41 | 2018-03-22T14:55:35.000Z | 2022-01-19T17:09:43.000Z | experiments/mario/gym-nes-mario-bros-master/src/run-mario.py | selfemergence/NEAT-multiprocessing | 3dc57c6ec18658253398ae0b361b72f78e3fd0c9 | [
"MIT"
] | 3 | 2018-03-30T09:29:28.000Z | 2019-01-20T22:51:17.000Z | experiments/mario/gym-nes-mario-bros-master/src/run-mario.py | selfemergence/NEAT-multiprocessing | 3dc57c6ec18658253398ae0b361b72f78e3fd0c9 | [
"MIT"
] | 14 | 2018-05-24T01:45:15.000Z | 2022-01-31T14:22:53.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# By Lilian Besson (Naereen)
# https://github.com/Naereen/gym-nes-mario-bros
# MIT License https://lbesson.mit-license.org/
#
from __future__ import division, print_function # Python 2 compatibility
import os
import sys
from collections import deque
from time import sleep... | 35.468293 | 255 | 0.625636 |
from __future__ import division, print_function
import os
import sys
from collections import deque
from time import sleep
PARALLEL_EMULATORS = 1
)
if PARALLEL_EMULATORS > 1:
print("WARNING: It's not working with more than one emulator in parallel!")
# FIXME use joblib for something smart?
# from jobli... | true | true |
f7542263f291d725a6be30117d996cfa8a61d5dc | 2,528 | py | Python | models/vae.py | susanwe/world-models | 0f246a430683e6ab741726df0a97f35830044356 | [
"MIT"
] | null | null | null | models/vae.py | susanwe/world-models | 0f246a430683e6ab741726df0a97f35830044356 | [
"MIT"
] | null | null | null | models/vae.py | susanwe/world-models | 0f246a430683e6ab741726df0a97f35830044356 | [
"MIT"
] | null | null | null |
"""
Variational encoder model, used as a visual model
for our model of the world.
"""
import torch
import torch.nn as nn
import torch.nn.functional as F
class Decoder(nn.Module):
""" VAE decoder """
def __init__(self, img_channels, latent_size):
super(Decoder, self).__init__()
self.latent_size... | 33.263158 | 72 | 0.623418 |
import torch
import torch.nn as nn
import torch.nn.functional as F
class Decoder(nn.Module):
def __init__(self, img_channels, latent_size):
super(Decoder, self).__init__()
self.latent_size = latent_size
self.img_channels = img_channels
self.fc1 = nn.Linear(latent_size, 1024)
... | true | true |
f75422b4c55b8cdb52932fdd61bb5310a22e2332 | 935 | py | Python | stake_last_all_api/account_rpc_interface_account_manage/account_createAccount.py | DerWalundDieKatze/Yumekui | cb3174103ced7474ce6d1abd774b399557dcaf4f | [
"Apache-2.0"
] | null | null | null | stake_last_all_api/account_rpc_interface_account_manage/account_createAccount.py | DerWalundDieKatze/Yumekui | cb3174103ced7474ce6d1abd774b399557dcaf4f | [
"Apache-2.0"
] | null | null | null | stake_last_all_api/account_rpc_interface_account_manage/account_createAccount.py | DerWalundDieKatze/Yumekui | cb3174103ced7474ce6d1abd774b399557dcaf4f | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# encoding: utf-8
'''
@author: caroline
@license: (C) Copyright 2019-2022, Node Supply Chain Manager Corporation Limited.
@contact: caroline.fang.cc@gmail.com
@software: pycharm
@file: account_createAccount.py
@time: 2020/1/8 5:38 下午
@desc:
'''
from stake_last_all_api.API import request_Api
'''2... | 23.974359 | 152 | 0.718717 |
from stake_last_all_api.API import request_Api
def createAccount(api_name, params):
try:
result = request_Api(api_name, params)
print("创建本地账号成功,返回值为{}".format(result))
return result
except Exception as e:
print("创建本地账号失败,api返回错误,返回值为{}".format(e))
return -1
if __name__ == '__main__':
api_name = "ac... | true | true |
f75422faa66b80e55c177cfefdcbfb9ee6b32272 | 663 | py | Python | tests/helper.py | laszewsk/pandoc-codeblock-include | 183dc52b48d6dea9d1651ab0c2cb5e60cfff2781 | [
"BSD-3-Clause"
] | null | null | null | tests/helper.py | laszewsk/pandoc-codeblock-include | 183dc52b48d6dea9d1651ab0c2cb5e60cfff2781 | [
"BSD-3-Clause"
] | null | null | null | tests/helper.py | laszewsk/pandoc-codeblock-include | 183dc52b48d6dea9d1651ab0c2cb5e60cfff2781 | [
"BSD-3-Clause"
] | null | null | null | # This Python file uses the following encoding: utf-8
from panflute import *
import pandoc_codeblock_include
def conversion(markdown, format='markdown'):
doc = convert_text(markdown, standalone = True)
doc.format = format
pandoc_codeblock_include.main(doc)
return doc
def verify_conversion(markdown, ... | 30.136364 | 124 | 0.711916 |
from panflute import *
import pandoc_codeblock_include
def conversion(markdown, format='markdown'):
doc = convert_text(markdown, standalone = True)
doc.format = format
pandoc_codeblock_include.main(doc)
return doc
def verify_conversion(markdown, expected, format='markdown'):
doc = conversion(ma... | true | true |
f754233dfb866002dd6913814c66161604e47b09 | 4,027 | py | Python | autotest/gdrivers/srtmhgt.py | tbonfort/gdal | 173e0659bc3f2e6b97c2c07332a3066478afb821 | [
"MIT"
] | 1 | 2015-04-21T19:52:03.000Z | 2015-04-21T19:52:03.000Z | autotest/gdrivers/srtmhgt.py | tbonfort/gdal | 173e0659bc3f2e6b97c2c07332a3066478afb821 | [
"MIT"
] | 1 | 2016-04-04T09:14:19.000Z | 2016-04-14T19:17:10.000Z | autotest/gdrivers/srtmhgt.py | pramsey/gdal | 965421b79fe4d3332b0f2f633b072fdcab2b700a | [
"MIT"
] | null | null | null | #!/usr/bin/env python
###############################################################################
# $Id$
#
# Project: GDAL/OGR Test Suite
# Purpose: Test SRTMHGT support.
# Author: Even Rouault < even dot rouault @ mines-paris dot org >
#
#########################################################################... | 31.708661 | 158 | 0.610877 | true | true | |
f7542397efca9abb4281934911ddd53734ebee37 | 7,845 | py | Python | bin/azure/graphrbac/models/service_principal.py | zdmc23/bash-lambda-layer | e762df0189cfb894dab2d96bae1655b8857d5efb | [
"MIT"
] | null | null | null | bin/azure/graphrbac/models/service_principal.py | zdmc23/bash-lambda-layer | e762df0189cfb894dab2d96bae1655b8857d5efb | [
"MIT"
] | null | null | null | bin/azure/graphrbac/models/service_principal.py | zdmc23/bash-lambda-layer | e762df0189cfb894dab2d96bae1655b8857d5efb | [
"MIT"
] | 2 | 2021-05-23T16:46:31.000Z | 2021-05-26T23:51:09.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 49.968153 | 112 | 0.679159 |
from .directory_object import DirectoryObject
class ServicePrincipal(DirectoryObject):
_validation = {
'object_id': {'readonly': True},
'deletion_timestamp': {'readonly': True},
'object_type': {'required': True},
'app_display_name': {'readonly': True},
'app_owne... | true | true |
f754242081f1e3709306660d14fa24ddf0e80485 | 4,822 | py | Python | from_yolov5repo_to_fork.py | airctic/yolov5-pip-converter | 5132a48d1da0b24970b35dccdc1e9d91eb142e4b | [
"Apache-2.0"
] | 2 | 2021-04-13T11:01:18.000Z | 2021-04-15T09:33:27.000Z | from_yolov5repo_to_fork.py | airctic/yolov5-pip-converter | 5132a48d1da0b24970b35dccdc1e9d91eb142e4b | [
"Apache-2.0"
] | null | null | null | from_yolov5repo_to_fork.py | airctic/yolov5-pip-converter | 5132a48d1da0b24970b35dccdc1e9d91eb142e4b | [
"Apache-2.0"
] | 1 | 2022-03-17T09:20:37.000Z | 2022-03-17T09:20:37.000Z | from pathlib import Path
import shutil
import os
import sys
def convert_repo_to_fork(path2repo):
path_fork = path2repo.parent / "yolov5-icevision" # path of our fork
if path_fork.is_dir():
shutil.rmtree(path_fork)
path_fork.mkdir(exist_ok=True)
_ = shutil.copytree(path2repo, path_fork, dir... | 25.924731 | 117 | 0.6292 | from pathlib import Path
import shutil
import os
import sys
def convert_repo_to_fork(path2repo):
path_fork = path2repo.parent / "yolov5-icevision"
if path_fork.is_dir():
shutil.rmtree(path_fork)
path_fork.mkdir(exist_ok=True)
_ = shutil.copytree(path2repo, path_fork, dirs_exist_ok=True)
... | true | true |
f75425cb72867c52da1ee234a418e13523daa8df | 1,507 | py | Python | Game23/Game23.py | dwlcreat/dsf | 51af9107367dd8abc34b90230465f40f6950cdec | [
"MIT"
] | 2 | 2020-06-11T13:44:30.000Z | 2020-06-11T13:44:32.000Z | Game23/Game23.py | dwlcreat/dsf | 51af9107367dd8abc34b90230465f40f6950cdec | [
"MIT"
] | null | null | null | Game23/Game23.py | dwlcreat/dsf | 51af9107367dd8abc34b90230465f40f6950cdec | [
"MIT"
] | 1 | 2020-04-27T15:13:50.000Z | 2020-04-27T15:13:50.000Z | '''
Function:
2048小游戏
Author:
Charles
微信公众号:
Charles的皮卡丘
'''
import cfg
import sys
import pygame
from modules.utils import *
from modules.Game2048 import *
from modules.endInterface import *
'''主程序'''
def main(cfg):
# 游戏初始化
pygame.init()
screen = pygame.display.set_mode(cfg.SCREENSIZE)
pygame.display.set_capti... | 25.116667 | 130 | 0.721964 | import cfg
import sys
import pygame
from modules.utils import *
from modules.Game2048 import *
from modules.endInterface import *
def main(cfg):
pygame.init()
screen = pygame.display.set_mode(cfg.SCREENSIZE)
pygame.display.set_caption('2048 —— 微信公众号:Charles的皮卡丘')
pygame.mixer.music.load(cfg.BGMPATH)
pygame.m... | true | true |
f754265a4563f6595547699085ac86c96d9efe1a | 131 | py | Python | evan/api/permissions/contents.py | eillarra/evan | befe0f8daedd1b1f629097110d92e68534e43da1 | [
"MIT"
] | null | null | null | evan/api/permissions/contents.py | eillarra/evan | befe0f8daedd1b1f629097110d92e68534e43da1 | [
"MIT"
] | 20 | 2021-03-31T20:10:46.000Z | 2022-02-15T09:58:13.000Z | evan/api/permissions/contents.py | eillarra/evan | befe0f8daedd1b1f629097110d92e68534e43da1 | [
"MIT"
] | null | null | null | from .events import EventRelatedObjectPermission
class ContentPermission(EventRelatedObjectPermission):
allow_delete = False
| 21.833333 | 54 | 0.847328 | from .events import EventRelatedObjectPermission
class ContentPermission(EventRelatedObjectPermission):
allow_delete = False
| true | true |
f7542729616b072cc26b2cf31dc82c463a20c77e | 1,753 | py | Python | aliyun-python-sdk-scdn/aliyunsdkscdn/request/v20171115/SetScdnDomainBizInfoRequest.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | 1,001 | 2015-07-24T01:32:41.000Z | 2022-03-25T01:28:18.000Z | aliyun-python-sdk-scdn/aliyunsdkscdn/request/v20171115/SetScdnDomainBizInfoRequest.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | 363 | 2015-10-20T03:15:00.000Z | 2022-03-08T12:26:19.000Z | aliyun-python-sdk-scdn/aliyunsdkscdn/request/v20171115/SetScdnDomainBizInfoRequest.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | 682 | 2015-09-22T07:19:02.000Z | 2022-03-22T09:51:46.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 35.06 | 74 | 0.763263 |
from aliyunsdkcore.request import RpcRequest
from aliyunsdkscdn.endpoint import endpoint_data
class SetScdnDomainBizInfoRequest(RpcRequest):
def __init__(self):
RpcRequest.__init__(self, 'scdn', '2017-11-15', 'SetScdnDomainBizInfo')
self.set_method('GET')
if hasattr(self, "endpoint_map"):
... | true | true |
f754276821deed0b2cf600e0a1bcae30113a2ba5 | 6,527 | py | Python | tidepool_data_science_models/models/icgm_sensor_generator.py | tidepool-org/data-science-models | cd06e9aad95a0bc6cc2a81871e567c88159b86d3 | [
"BSD-2-Clause"
] | 1 | 2020-10-17T19:48:38.000Z | 2020-10-17T19:48:38.000Z | tidepool_data_science_models/models/icgm_sensor_generator.py | tidepool-org/data-science-models | cd06e9aad95a0bc6cc2a81871e567c88159b86d3 | [
"BSD-2-Clause"
] | 4 | 2020-05-27T16:38:56.000Z | 2020-11-21T21:09:23.000Z | tidepool_data_science_models/models/icgm_sensor_generator.py | tidepool-org/data-science-models | cd06e9aad95a0bc6cc2a81871e567c88159b86d3 | [
"BSD-2-Clause"
] | null | null | null | """
Creates iCGM Sensors given a trueBG trace
The Dexcom G6 Specifications in this file are publicly available from:
“EVALUATION OF AUTOMATIC CLASS III DESIGNATION FOR
Dexcom G6 Continuous Glucose Monitoring System.” n.d.
https://www.accessdata.fda.gov/cdrh_docs/reviews/DEN170088.pdf.
"""
# %% Libraries
... | 34.172775 | 104 | 0.629998 |
import numpy as np
from scipy.optimize import brute, fmin
from tidepool_data_science_models.models.icgm_sensor import iCGMSensor
import tidepool_data_science_models.models.icgm_sensor_generator_functions as sf
import multiprocessing
multiprocessing.set_start_method("fork")
class iCGMSensorGenerator(object):
d... | true | true |
f754282b4c0484e278cf3311f77c3440b8833e62 | 63,444 | py | Python | cctbx/crystal/tst_ext.py | dperl-sol/cctbx_project | b9e390221a2bc4fd00b9122e97c3b79c632c6664 | [
"BSD-3-Clause-LBNL"
] | 155 | 2016-11-23T12:52:16.000Z | 2022-03-31T15:35:44.000Z | cctbx/crystal/tst_ext.py | dperl-sol/cctbx_project | b9e390221a2bc4fd00b9122e97c3b79c632c6664 | [
"BSD-3-Clause-LBNL"
] | 590 | 2016-12-10T11:31:18.000Z | 2022-03-30T23:10:09.000Z | cctbx/crystal/tst_ext.py | dperl-sol/cctbx_project | b9e390221a2bc4fd00b9122e97c3b79c632c6664 | [
"BSD-3-Clause-LBNL"
] | 115 | 2016-11-15T08:17:28.000Z | 2022-02-09T15:30:14.000Z | from __future__ import absolute_import, division, print_function
from cctbx import crystal
import cctbx.crystal.coordination_sequences
from cctbx import sgtbx, xray
import cctbx.crystal.direct_space_asu
from cctbx import uctbx
from cctbx.array_family import flex
from scitbx import matrix
from libtbx.test_utils import E... | 37.408019 | 88 | 0.655381 | from __future__ import absolute_import, division, print_function
from cctbx import crystal
import cctbx.crystal.coordination_sequences
from cctbx import sgtbx, xray
import cctbx.crystal.direct_space_asu
from cctbx import uctbx
from cctbx.array_family import flex
from scitbx import matrix
from libtbx.test_utils import E... | true | true |
f75428914e3310cbaa625cfc1f8d3b573ed9bc60 | 475 | py | Python | bitcoinscript/misc.py | fungibit/bitcoinscript | ced6fb37dfa40eac7341826c758842e0ed7e7475 | [
"MIT"
] | 1 | 2017-10-25T17:11:44.000Z | 2017-10-25T17:11:44.000Z | bitcoinscript/misc.py | fungibit/bitcoinscript | ced6fb37dfa40eac7341826c758842e0ed7e7475 | [
"MIT"
] | 3 | 2017-03-10T05:27:29.000Z | 2017-04-07T16:06:28.000Z | bitcoinscript/misc.py | fungibit/bitcoinscript | ced6fb37dfa40eac7341826c758842e0ed7e7475 | [
"MIT"
] | null | null | null | """
Miscellaneous non-bitcoin-related tools used throughout this package.
"""
################################################################################
# source: http://stackoverflow.com/a/22729414
class classproperty(object):
""" @classmethod+@property """
def __init__(self, f):
self.f = class... | 29.6875 | 80 | 0.431579 | true | true | |
f75428e93a7d3fe77968888bfabc162ffb40b85d | 35,842 | py | Python | iqplot/dist.py | tomroesch/iqplot | e13f9ac888d75093da05353ba80786804ec99418 | [
"MIT"
] | 5 | 2020-08-28T22:46:39.000Z | 2022-02-03T15:57:05.000Z | iqplot/dist.py | tomroesch/iqplot | e13f9ac888d75093da05353ba80786804ec99418 | [
"MIT"
] | 15 | 2020-08-14T22:10:38.000Z | 2022-02-03T16:09:26.000Z | iqplot/dist.py | tomroesch/iqplot | e13f9ac888d75093da05353ba80786804ec99418 | [
"MIT"
] | 2 | 2021-08-07T00:45:12.000Z | 2021-09-15T21:11:00.000Z | """Visualization of how data are distributed, split or colored by a
categorical variable."""
import copy
import warnings
import numpy as np
import pandas as pd
import colorcet
import bokeh.models
import bokeh.plotting
from . import utils
def ecdf(
data=None,
q=None,
cats=None,
q_axis="x",
pal... | 34.764306 | 260 | 0.578818 |
import copy
import warnings
import numpy as np
import pandas as pd
import colorcet
import bokeh.models
import bokeh.plotting
from . import utils
def ecdf(
data=None,
q=None,
cats=None,
q_axis="x",
palette=None,
order=None,
p=None,
show_legend=True,
legend_label=None,
legen... | true | true |
f75428ffe7b26cc320721d550ad2fb04dd73dad0 | 2,164 | py | Python | ansible/modules/windows/win_tempfile.py | EnjoyLifeFund/macHighSierra-py36-pkgs | 5668b5785296b314ea1321057420bcd077dba9ea | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | 1 | 2021-04-02T08:08:39.000Z | 2021-04-02T08:08:39.000Z | ansible/modules/windows/win_tempfile.py | EnjoyLifeFund/Debian_py36_packages | 1985d4c73fabd5f08f54b922e73a9306e09c77a5 | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | null | null | null | ansible/modules/windows/win_tempfile.py | EnjoyLifeFund/Debian_py36_packages | 1985d4c73fabd5f08f54b922e73a9306e09c77a5 | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | 1 | 2020-05-03T01:13:16.000Z | 2020-05-03T01:13:16.000Z | #!/usr/bin/python
# coding: utf-8 -*-
# (c) 2017 Dag Wieers <dag@wieers.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# ... | 28.103896 | 90 | 0.701941 |
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
DOCUMENTATION = r'''
---
module: win_tempfile
version_added: "2.3"
author: Dag Wieers (@dagwieers)
short_description: Creates temporary files and directories.
... | true | true |
f754299f7bee1c91d24ae7320ff2eceddd1a16fe | 1,972 | py | Python | icon.py | ccacNMorris/dat129_ccac | 587e35f7886d1e883ad988cbe2ec027eb9cf3043 | [
"Apache-2.0"
] | null | null | null | icon.py | ccacNMorris/dat129_ccac | 587e35f7886d1e883ad988cbe2ec027eb9cf3043 | [
"Apache-2.0"
] | null | null | null | icon.py | ccacNMorris/dat129_ccac | 587e35f7886d1e883ad988cbe2ec027eb9cf3043 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Feb 2 18:34:05 2020
@author: leemshari
"""
# I wanted to create an n cubed icon
#My goal was to get this to get this to print with & or @ signs but I was unable to
#get this array to look decent with anything but integers.
#I changed the dtype to str ... | 32.866667 | 95 | 0.682556 |
import numpy as np
def icon (tuple_list,int_array):
for a,b in tuple_list:
int_array[a,b] = 3
return int_array
def roll_rotate(a_tuple,a_array):
b_array = icon(a_tuple,a_array)
print(np.roll(b_array,1))
print('')
print(np.flipud(b_array))
def resize(b_tupl... | true | true |
f7542a47ff90fd77821f8c0265593087d8f9e65c | 3,665 | py | Python | packages/syft/src/syft/core/node/common/node_service/publish/publish_service.py | jackbandy/PySyft | 0e20e90abab6a7a7ca672d6eedfa1e7f83c4981b | [
"Apache-2.0"
] | null | null | null | packages/syft/src/syft/core/node/common/node_service/publish/publish_service.py | jackbandy/PySyft | 0e20e90abab6a7a7ca672d6eedfa1e7f83c4981b | [
"Apache-2.0"
] | null | null | null | packages/syft/src/syft/core/node/common/node_service/publish/publish_service.py | jackbandy/PySyft | 0e20e90abab6a7a7ca672d6eedfa1e7f83c4981b | [
"Apache-2.0"
] | null | null | null | # stdlib
from typing import Dict as TypeDict
from typing import List as TypeList
from typing import Optional
from typing import Type
# third party
from nacl.signing import VerifyKey
# relative
from ......logger import traceback_and_raise # type: ignore
from .....adp.data_subject_ledger import DataSubjectLedger # ty... | 41.179775 | 101 | 0.612005 |
from typing import Dict as TypeDict
from typing import List as TypeList
from typing import Optional
from typing import Type
from nacl.signing import VerifyKey
from ......logger import traceback_and_raise
from .....adp.data_subject_ledger import DataSubjectLedger
from .....common.uid import UID
from .....stor... | true | true |
f7542a48738b3086c1f16e98ccdcd66df46f3a18 | 65 | py | Python | test/test_project/init_order/first.py | rob-smallshire/cosmic-ray | 4fd751b38eee30568f8366e09452d7aa60be4e26 | [
"MIT"
] | 1 | 2020-10-18T11:29:03.000Z | 2020-10-18T11:29:03.000Z | test/test_project/init_order/first.py | rob-smallshire/cosmic-ray | 4fd751b38eee30568f8366e09452d7aa60be4e26 | [
"MIT"
] | 4 | 2020-11-21T07:36:24.000Z | 2020-11-22T03:09:39.000Z | test/test_project/init_order/first.py | rob-smallshire/cosmic-ray | 4fd751b38eee30568f8366e09452d7aa60be4e26 | [
"MIT"
] | 1 | 2021-11-10T10:42:57.000Z | 2021-11-10T10:42:57.000Z | import init_order
init_order.initialized = True
print('first')
| 10.833333 | 29 | 0.784615 | import init_order
init_order.initialized = True
print('first')
| true | true |
f7542b024498b7a7e970ae6e8e7920fdd4e061e0 | 476 | py | Python | test/runtests.py | carneirofc/pyaccel | e639cb6191293eec4c05aeeaf513d9066de8da2b | [
"MIT"
] | 6 | 2015-04-13T23:47:37.000Z | 2021-12-09T17:48:01.000Z | test/runtests.py | carneirofc/pyaccel | e639cb6191293eec4c05aeeaf513d9066de8da2b | [
"MIT"
] | 53 | 2015-04-13T23:35:42.000Z | 2021-12-16T02:44:37.000Z | test/runtests.py | carneirofc/pyaccel | e639cb6191293eec4c05aeeaf513d9066de8da2b | [
"MIT"
] | 3 | 2015-11-06T05:20:57.000Z | 2022-02-08T13:10:20.000Z | #!/usr/bin/env python3
import unittest
import test_elements
import test_accelerator
import test_tracking
import test_lattice
import test_optics
suite_list = []
suite_list.append(test_elements.get_suite())
suite_list.append(test_accelerator.get_suite())
suite_list.append(test_lattice.get_suite())
suite_list.append(te... | 23.8 | 47 | 0.834034 |
import unittest
import test_elements
import test_accelerator
import test_tracking
import test_lattice
import test_optics
suite_list = []
suite_list.append(test_elements.get_suite())
suite_list.append(test_accelerator.get_suite())
suite_list.append(test_lattice.get_suite())
suite_list.append(test_tracking.get_suite(... | true | true |
f7542ba8526bc71f5ad701b7d7171ada72b47cfa | 8,557 | py | Python | tests/test_csek.py | noahdietz/storage-testbench | b122e47b69cabcdf981969068df0e9d805f129a3 | [
"Apache-2.0"
] | 4 | 2021-08-20T12:27:11.000Z | 2022-01-24T12:20:19.000Z | tests/test_csek.py | noahdietz/storage-testbench | b122e47b69cabcdf981969068df0e9d805f129a3 | [
"Apache-2.0"
] | 260 | 2021-06-29T00:50:44.000Z | 2022-03-30T12:25:26.000Z | tests/test_csek.py | noahdietz/storage-testbench | b122e47b69cabcdf981969068df0e9d805f129a3 | [
"Apache-2.0"
] | 11 | 2021-06-14T16:25:31.000Z | 2022-03-22T19:42:49.000Z | #!/usr/bin/env python3
#
# Copyright 2021 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 40.363208 | 84 | 0.623934 |
import base64
import hashlib
import unittest
from unittest.mock import ANY, Mock
import grpc
from werkzeug.test import create_environ
from werkzeug.wrappers import Request
from google.storage.v2 import storage_pb2
from testbench import csek, error
class TestCSEK(unittest.TestCase):
def test_ext... | true | true |
f7542ce646d836e4bbf6f685ba3aa38ff52dbfc5 | 5,063 | py | Python | venv/Lib/site-packages/pandas/tests/frame/methods/test_filter.py | arnoyu-hub/COMP0016miemie | 59af664dcf190eab4f93cefb8471908717415fea | [
"MIT"
] | null | null | null | venv/Lib/site-packages/pandas/tests/frame/methods/test_filter.py | arnoyu-hub/COMP0016miemie | 59af664dcf190eab4f93cefb8471908717415fea | [
"MIT"
] | null | null | null | venv/Lib/site-packages/pandas/tests/frame/methods/test_filter.py | arnoyu-hub/COMP0016miemie | 59af664dcf190eab4f93cefb8471908717415fea | [
"MIT"
] | 1 | 2021-04-26T22:41:56.000Z | 2021-04-26T22:41:56.000Z | import numpy as np
import pytest
import pandas as pd
from pandas import DataFrame
import pandas._testing as tm
class TestDataFrameFilter:
def test_filter(self, float_frame, float_string_frame):
# Items
filtered = float_frame.filter(["A", "B", "E"])
assert len(filtered.columns)... | 36.164286 | 80 | 0.562117 | import numpy as np
import pytest
import pandas as pd
from pandas import DataFrame
import pandas._testing as tm
class TestDataFrameFilter:
def test_filter(self, float_frame, float_string_frame):
filtered = float_frame.filter(["A", "B", "E"])
assert len(filtered.columns) == 2
... | true | true |
f7542cf57a22ab608ffec77f9fdc75d21edc3583 | 1,596 | py | Python | spotty/commands/start.py | Inculus/spotty | 56863012668a6c13ad13c2a04f900047e229fbe6 | [
"MIT"
] | 1 | 2020-07-17T07:02:09.000Z | 2020-07-17T07:02:09.000Z | spotty/commands/start.py | Inculus/spotty | 56863012668a6c13ad13c2a04f900047e229fbe6 | [
"MIT"
] | null | null | null | spotty/commands/start.py | Inculus/spotty | 56863012668a6c13ad13c2a04f900047e229fbe6 | [
"MIT"
] | null | null | null | from argparse import Namespace, ArgumentParser
from spotty.commands.abstract_config_command import AbstractConfigCommand
from spotty.commands.writers.abstract_output_writrer import AbstractOutputWriter
from spotty.providers.abstract_instance_manager import AbstractInstanceManager
class StartCommand(AbstractConfigComm... | 48.363636 | 114 | 0.634712 | from argparse import Namespace, ArgumentParser
from spotty.commands.abstract_config_command import AbstractConfigCommand
from spotty.commands.writers.abstract_output_writrer import AbstractOutputWriter
from spotty.providers.abstract_instance_manager import AbstractInstanceManager
class StartCommand(AbstractConfigComm... | true | true |
f7542d6a17d0986919e414b1d927a35e40dcdb6c | 485 | py | Python | profiles_api/urls.py | c12121234/practice-REST-API | 72bfa241d520eea29b896598c79fb79dfdacc366 | [
"MIT"
] | null | null | null | profiles_api/urls.py | c12121234/practice-REST-API | 72bfa241d520eea29b896598c79fb79dfdacc366 | [
"MIT"
] | null | null | null | profiles_api/urls.py | c12121234/practice-REST-API | 72bfa241d520eea29b896598c79fb79dfdacc366 | [
"MIT"
] | null | null | null | from django.urls import path,include
from rest_framework.routers import DefaultRouter
from profiles_api import views
router = DefaultRouter()
router.register('hello-viewset',views.HelloViewSet,base_name='hello-viewset')
router.register('profile',views.UserProfileViewSet)
router.register('feed',views.UserProfileFeedVie... | 32.333333 | 77 | 0.783505 | from django.urls import path,include
from rest_framework.routers import DefaultRouter
from profiles_api import views
router = DefaultRouter()
router.register('hello-viewset',views.HelloViewSet,base_name='hello-viewset')
router.register('profile',views.UserProfileViewSet)
router.register('feed',views.UserProfileFeedVie... | true | true |
f7542e205841abba68a7bf9f11b9f9b5d6d3e90b | 6,101 | py | Python | onmt/translate/translation.py | KaijuML/data2text-macro-plan-py | 17cebc5db507723d601d21a075adea59b0bd9ffb | [
"MIT"
] | 20 | 2021-02-07T03:20:39.000Z | 2022-02-18T03:09:48.000Z | onmt/translate/translation.py | KaijuML/data2text-macro-plan-py | 17cebc5db507723d601d21a075adea59b0bd9ffb | [
"MIT"
] | 2 | 2021-04-12T14:33:55.000Z | 2021-10-21T21:49:21.000Z | onmt/translate/translation.py | KaijuML/data2text-macro-plan-py | 17cebc5db507723d601d21a075adea59b0bd9ffb | [
"MIT"
] | 6 | 2021-06-04T08:13:55.000Z | 2022-03-21T18:10:09.000Z | """ Translation main class """
from __future__ import unicode_literals, print_function
import torch
from onmt.inputters.text_dataset import TextMultiField
class TranslationBuilder(object):
"""
Build a word-based translation from the batch output
of translator and the underlying dictionaries.
Replace... | 37.89441 | 78 | 0.561711 | from __future__ import unicode_literals, print_function
import torch
from onmt.inputters.text_dataset import TextMultiField
class TranslationBuilder(object):
def __init__(self, data, fields, n_best=1, replace_unk=False,
has_tgt=False, phrase_table=""):
self.data = data
self.fiel... | true | true |
f7542f96f42dfed78ec29a48a83a1d0a8224aeaf | 250 | py | Python | funcx_endpoint/funcx_endpoint/version.py | sirosen/funcX | e41a08ec8d125f0a7c86cf2b3ca1c7e87ed3a0fc | [
"Apache-1.1"
] | null | null | null | funcx_endpoint/funcx_endpoint/version.py | sirosen/funcX | e41a08ec8d125f0a7c86cf2b3ca1c7e87ed3a0fc | [
"Apache-1.1"
] | null | null | null | funcx_endpoint/funcx_endpoint/version.py | sirosen/funcX | e41a08ec8d125f0a7c86cf2b3ca1c7e87ed3a0fc | [
"Apache-1.1"
] | null | null | null | # single source of truth for package version,
# see https://packaging.python.org/en/latest/single_source_version/
__version__ = "0.2.3"
VERSION = __version__
# app name to send as part of requests
app_name = "funcX Endpoint v{}".format(__version__)
| 31.25 | 67 | 0.764 |
__version__ = "0.2.3"
VERSION = __version__
app_name = "funcX Endpoint v{}".format(__version__)
| true | true |
f754307242a8eb5a9177b06e508ec5e96687206e | 4,588 | py | Python | common/data/achievements.py | andresokol/vas3k.club | 4163c2c0a337feb492c2e7fbed26e4f44201f269 | [
"MIT"
] | null | null | null | common/data/achievements.py | andresokol/vas3k.club | 4163c2c0a337feb492c2e7fbed26e4f44201f269 | [
"MIT"
] | null | null | null | common/data/achievements.py | andresokol/vas3k.club | 4163c2c0a337feb492c2e7fbed26e4f44201f269 | [
"MIT"
] | 1 | 2021-10-04T13:45:58.000Z | 2021-10-04T13:45:58.000Z | ACHIEVEMENTS = [
("old", {
"name": "Олды здесь",
"description": "Почётный ранний член Клуба",
"image": "https://i.vas3k.club/3bl.png",
"style": "color: #FFF; background-color: #65c3ba;",
}),
("investor_1000", {
"name": "Ёрли Инвестор",
"description": "Человек,... | 42.091743 | 117 | 0.578248 | ACHIEVEMENTS = [
("old", {
"name": "Олды здесь",
"description": "Почётный ранний член Клуба",
"image": "https://i.vas3k.club/3bl.png",
"style": "color: #FFF; background-color: #65c3ba;",
}),
("investor_1000", {
"name": "Ёрли Инвестор",
"description": "Человек,... | true | true |
f754312d7b17181075436150ae42a5f3e9bdbfe3 | 549 | py | Python | tests/petstore/user/deleteUser_test.py | andriis/bravado | 0d2ef182df4eb38641282e2f839c4dc813ee4349 | [
"BSD-3-Clause"
] | 19 | 2017-11-20T22:47:12.000Z | 2021-12-23T15:56:41.000Z | tests/petstore/user/deleteUser_test.py | andriis/bravado | 0d2ef182df4eb38641282e2f839c4dc813ee4349 | [
"BSD-3-Clause"
] | 10 | 2018-01-11T12:53:01.000Z | 2020-01-27T20:05:51.000Z | tests/petstore/user/deleteUser_test.py | andriis/bravado | 0d2ef182df4eb38641282e2f839c4dc813ee4349 | [
"BSD-3-Clause"
] | 4 | 2017-11-18T12:37:14.000Z | 2021-03-19T14:48:13.000Z | # -*- coding: utf-8 -*-
from __future__ import print_function
import pytest
def test_200_success(petstore):
result = petstore.user.deleteUser(username='bozo').result()
assert result is None
@pytest.mark.xfail(reason="Can't get this to 404")
def test_404_user_not_found(petstore):
result = petstore.user.... | 24.954545 | 63 | 0.734062 |
from __future__ import print_function
import pytest
def test_200_success(petstore):
result = petstore.user.deleteUser(username='bozo').result()
assert result is None
@pytest.mark.xfail(reason="Can't get this to 404")
def test_404_user_not_found(petstore):
result = petstore.user.deleteUser(username='zz... | true | true |
f75431893cfd55eb36bb1b9cab14f873ade87a28 | 2,737 | py | Python | myproject/blog/views.py | Kumarmanishio/demo-project | 0a5ac91f5c13af27e458dd9821231e501d8dda37 | [
"MIT"
] | null | null | null | myproject/blog/views.py | Kumarmanishio/demo-project | 0a5ac91f5c13af27e458dd9821231e501d8dda37 | [
"MIT"
] | 1 | 2021-06-10T23:05:41.000Z | 2021-06-10T23:05:41.000Z | myproject/blog/views.py | Kumarmanishio/demo-project | 0a5ac91f5c13af27e458dd9821231e501d8dda37 | [
"MIT"
] | null | null | null | from django.views import generic
from .forms import *
from django.shortcuts import render, redirect, get_object_or_404
from .forms import PostForm
from .models import Post, Blog
from django.views.generic import ListView, DetailView
from django.contrib.auth.models import User, auth
from django.contrib import messages
... | 32.583333 | 139 | 0.648155 | from django.views import generic
from .forms import *
from django.shortcuts import render, redirect, get_object_or_404
from .forms import PostForm
from .models import Post, Blog
from django.views.generic import ListView, DetailView
from django.contrib.auth.models import User, auth
from django.contrib import messages
... | true | true |
f754322029843ccce1a236b8896998fc2928fe55 | 87 | py | Python | python/dgl/_deprecate/runtime/ir/registry.py | ketyi/dgl | a1b859c29b63a673c148d13231a49504740e0e01 | [
"Apache-2.0"
] | 9,516 | 2018-12-08T22:11:31.000Z | 2022-03-31T13:04:33.000Z | python/dgl/_deprecate/runtime/ir/registry.py | ketyi/dgl | a1b859c29b63a673c148d13231a49504740e0e01 | [
"Apache-2.0"
] | 2,494 | 2018-12-08T22:43:00.000Z | 2022-03-31T21:16:27.000Z | python/dgl/_deprecate/runtime/ir/registry.py | ketyi/dgl | a1b859c29b63a673c148d13231a49504740e0e01 | [
"Apache-2.0"
] | 2,529 | 2018-12-08T22:56:14.000Z | 2022-03-31T13:07:41.000Z | """Module for ir registry."""
from __future__ import absolute_import
IR_REGISTRY = {}
| 17.4 | 38 | 0.747126 | from __future__ import absolute_import
IR_REGISTRY = {}
| true | true |
f754324c1ad4de556043a43003c294d293071ca0 | 2,027 | py | Python | skyoffset/diffplot.py | jonathansick/skyoffset | 369f54d8a237f48cd56f550e80bf1d39b355bfcd | [
"BSD-3-Clause"
] | null | null | null | skyoffset/diffplot.py | jonathansick/skyoffset | 369f54d8a237f48cd56f550e80bf1d39b355bfcd | [
"BSD-3-Clause"
] | null | null | null | skyoffset/diffplot.py | jonathansick/skyoffset | 369f54d8a237f48cd56f550e80bf1d39b355bfcd | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# encoding: utf-8
"""
Plot distributions of difference pixels.
"""
import os
import numpy as np
import astropy.io.fits
from matplotlib.figure import Figure
from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas
import matplotlib.gridspec as gridspec
def plot_diffs(mosaic_d... | 33.783333 | 78 | 0.651209 |
import os
import numpy as np
import astropy.io.fits
from matplotlib.figure import Figure
from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas
import matplotlib.gridspec as gridspec
def plot_diffs(mosaic_doc, plot_dir):
if not os.path.exists(plot_dir):
os.makedirs(plot_dir)
f... | true | true |
f75432550332a98e29bcf4a7e601c6121da20aec | 3,914 | py | Python | caffe2/python/lazy_dyndep_test.py | Hacky-DH/pytorch | 80dc4be615854570aa39a7e36495897d8a040ecc | [
"Intel"
] | 60,067 | 2017-01-18T17:21:31.000Z | 2022-03-31T21:37:45.000Z | caffe2/python/lazy_dyndep_test.py | Hacky-DH/pytorch | 80dc4be615854570aa39a7e36495897d8a040ecc | [
"Intel"
] | 66,955 | 2017-01-18T17:21:38.000Z | 2022-03-31T23:56:11.000Z | caffe2/python/lazy_dyndep_test.py | Hacky-DH/pytorch | 80dc4be615854570aa39a7e36495897d8a040ecc | [
"Intel"
] | 19,210 | 2017-01-18T17:45:04.000Z | 2022-03-31T23:51:56.000Z | #!/usr/bin/env python3
from hypothesis import given, settings
import hypothesis.strategies as st
from multiprocessing import Process
import numpy as np
import tempfile
import shutil
import caffe2.python.hypothesis_test_util as hu
import unittest
op_engine = 'GLOO'
class TemporaryDirectory:
def __enter__(s... | 29.208955 | 96 | 0.637711 |
from hypothesis import given, settings
import hypothesis.strategies as st
from multiprocessing import Process
import numpy as np
import tempfile
import shutil
import caffe2.python.hypothesis_test_util as hu
import unittest
op_engine = 'GLOO'
class TemporaryDirectory:
def __enter__(self):
self.tmp... | true | true |
f754350c584489b464236e67f0e6dd48bd3a0548 | 891 | py | Python | zentral/contrib/inventory/migrations/0038_auto_20180623_1214.py | gwhitehawk/zentral | 156134aed3d7ff8a7cb40ab6f2269a763c316459 | [
"Apache-2.0"
] | 634 | 2015-10-30T00:55:40.000Z | 2022-03-31T02:59:00.000Z | zentral/contrib/inventory/migrations/0038_auto_20180623_1214.py | gwhitehawk/zentral | 156134aed3d7ff8a7cb40ab6f2269a763c316459 | [
"Apache-2.0"
] | 145 | 2015-11-06T00:17:33.000Z | 2022-03-16T13:30:31.000Z | zentral/contrib/inventory/migrations/0038_auto_20180623_1214.py | gwhitehawk/zentral | 156134aed3d7ff8a7cb40ab6f2269a763c316459 | [
"Apache-2.0"
] | 103 | 2015-11-07T07:08:49.000Z | 2022-03-18T17:34:36.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.10.8 on 2018-06-23 12:14
from __future__ import unicode_literals
import django.contrib.postgres.fields
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('inventory', '0037_aut... | 31.821429 | 146 | 0.672278 |
from __future__ import unicode_literals
import django.contrib.postgres.fields
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('inventory', '0037_auto_20180213_1407'),
]
operations = [
migrations.AddFiel... | true | true |
f75436c8be361f63a0769f8fb3129023e51e583c | 2,067 | py | Python | StructuralAnalysis/FrameElements/Element.py | Hazem-Kassab/StructuralAnalysis | d7e99a42c94fed787a2bc4931d33cd1ed65f8707 | [
"MIT"
] | 6 | 2021-02-08T13:00:40.000Z | 2022-02-18T07:11:14.000Z | StructuralAnalysis/FrameElements/Element.py | Hazem-Kassab/StructuralAnalysis | d7e99a42c94fed787a2bc4931d33cd1ed65f8707 | [
"MIT"
] | null | null | null | StructuralAnalysis/FrameElements/Element.py | Hazem-Kassab/StructuralAnalysis | d7e99a42c94fed787a2bc4931d33cd1ed65f8707 | [
"MIT"
] | 1 | 2022-03-12T03:14:39.000Z | 2022-03-12T03:14:39.000Z | from StructuralAnalysis.Node import Node
from math import sqrt
import numpy as np
from abc import abstractmethod, ABC
from StructuralAnalysis.DegreeOfFreedom import DegreeOfFreedom
from StructuralAnalysis.Section import Section
from StructuralAnalysis.Material import Material
class Element(ABC):
"""
This clas... | 29.112676 | 95 | 0.665699 | from StructuralAnalysis.Node import Node
from math import sqrt
import numpy as np
from abc import abstractmethod, ABC
from StructuralAnalysis.DegreeOfFreedom import DegreeOfFreedom
from StructuralAnalysis.Section import Section
from StructuralAnalysis.Material import Material
class Element(ABC):
id = 1
def ... | true | true |
f75437c38ac5e74cab775c1cd634732632bf57e5 | 169 | py | Python | Exercicios_Livros_Algoritmos/b.py | carlosrjhoe/Python | 2df531b23ebbabc40539b09bb2bbdbe1ed1c2164 | [
"MIT"
] | null | null | null | Exercicios_Livros_Algoritmos/b.py | carlosrjhoe/Python | 2df531b23ebbabc40539b09bb2bbdbe1ed1c2164 | [
"MIT"
] | null | null | null | Exercicios_Livros_Algoritmos/b.py | carlosrjhoe/Python | 2df531b23ebbabc40539b09bb2bbdbe1ed1c2164 | [
"MIT"
] | null | null | null | def ceulcius(x):
return (x - 32)/1.8
x = int(input('Digite uma temperatura em (F°): '))
print(f'A temperatura digitada em {x}F°, é igual a {ceulcius(x):.1f}C°') | 33.8 | 72 | 0.615385 | def ceulcius(x):
return (x - 32)/1.8
x = int(input('Digite uma temperatura em (F°): '))
print(f'A temperatura digitada em {x}F°, é igual a {ceulcius(x):.1f}C°') | true | true |
f75438129a425e0d305507b9ef795966818ab6a6 | 147 | py | Python | maps_drawer/map_server/mapserverapp/urls.py | ShrirangPatil/My-Expense-Manager | 538c746026e6070410cf784de308e75b99f1b0c4 | [
"MIT"
] | null | null | null | maps_drawer/map_server/mapserverapp/urls.py | ShrirangPatil/My-Expense-Manager | 538c746026e6070410cf784de308e75b99f1b0c4 | [
"MIT"
] | null | null | null | maps_drawer/map_server/mapserverapp/urls.py | ShrirangPatil/My-Expense-Manager | 538c746026e6070410cf784de308e75b99f1b0c4 | [
"MIT"
] | null | null | null | from django.contrib import admin
from django.urls import path
from mapserverapp import views
urlpatterns = [
path('', views.home,name="home"),
] | 18.375 | 34 | 0.755102 | from django.contrib import admin
from django.urls import path
from mapserverapp import views
urlpatterns = [
path('', views.home,name="home"),
] | true | true |
f75438953d671f90e67ce21d78b65807c6bfe855 | 3,764 | py | Python | mks/admin.py | navotsil/Open-Knesset | d6cc6457f87e67a3dbeaec9c1ccbc8d8b7c60c04 | [
"BSD-3-Clause"
] | null | null | null | mks/admin.py | navotsil/Open-Knesset | d6cc6457f87e67a3dbeaec9c1ccbc8d8b7c60c04 | [
"BSD-3-Clause"
] | null | null | null | mks/admin.py | navotsil/Open-Knesset | d6cc6457f87e67a3dbeaec9c1ccbc8d8b7c60c04 | [
"BSD-3-Clause"
] | null | null | null | from django.contrib import admin
from django.contrib.contenttypes import generic
from django.db.models import Q
from models import Member, Membership, MemberAltname
from models import CoalitionMembership, Correlation, Party, \
Award, AwardType, Knesset
from links.models import Link
from video.models import Video
f... | 30.601626 | 92 | 0.68916 | from django.contrib import admin
from django.contrib.contenttypes import generic
from django.db.models import Q
from models import Member, Membership, MemberAltname
from models import CoalitionMembership, Correlation, Party, \
Award, AwardType, Knesset
from links.models import Link
from video.models import Video
f... | true | true |
f75439cfa8c8fb1a705def97ed43fe068302fb48 | 255 | py | Python | luwu/core/models/classifier/kerastuner/__init__.py | AaronJny/luwu | 05ee0bc605926661e42cada6cff5e281f4506291 | [
"MIT"
] | 19 | 2021-01-30T03:04:31.000Z | 2022-01-09T10:33:12.000Z | luwu/core/models/classifier/kerastuner/__init__.py | AaronJny/luwu | 05ee0bc605926661e42cada6cff5e281f4506291 | [
"MIT"
] | 4 | 2021-04-15T02:10:53.000Z | 2021-06-24T12:17:29.000Z | luwu/core/models/classifier/kerastuner/__init__.py | AaronJny/luwu | 05ee0bc605926661e42cada6cff5e281f4506291 | [
"MIT"
] | 5 | 2021-03-02T07:29:12.000Z | 2022-01-09T10:32:49.000Z | # -*- coding: utf-8 -*-
# @Date : 2021-01-07
# @Author : AaronJny
# @LastEditTime : 2021-01-28
# @FilePath : /app/luwu/core/models/classifier/kerastuner/__init__.py
# @Desc :
"""
这是还在规划中的功能,里面的代码目前都是无用的。
TODO:增加KerasTuner相关功能
""" | 25.5 | 73 | 0.615686 | true | true | |
f75439d669a4296738b8f56f0a7ba3491ed6a67a | 14,438 | py | Python | semi/RegexSemI_Laptops11.py | Dagu9/Reinforcement-learning-SGD | eb4a2546d6c99917b33e8cc4c210709e7d4cc15e | [
"Apache-2.0"
] | 2 | 2020-01-20T14:43:27.000Z | 2021-04-29T12:21:05.000Z | semi/RegexSemI_Laptops11.py | vmishra04/Pydial | a689fa1177cd34f32dd4d30a5a6140fb721855bf | [
"Apache-2.0"
] | null | null | null | semi/RegexSemI_Laptops11.py | vmishra04/Pydial | a689fa1177cd34f32dd4d30a5a6140fb721855bf | [
"Apache-2.0"
] | null | null | null | ###############################################################################
# PyDial: Multi-domain Statistical Spoken Dialogue System Software
###############################################################################
#
# Copyright 2015 - 2019
# Cambridge University Engineering Department Dialogue Systems Grou... | 50.482517 | 123 | 0.555756 | ed\ )*(for\ )*business(\ computing)*"
self.slot_values[slot]['0']+="|i\ want\ a\ gaming(\ laptop)*|(i\ want\ it\ )*for\ (fun|games|play|gaming|leisure))"
# SLOT: driverange
slot = 'driverange'
# {u'small': '(small)', u'large': '(large)', u'medium': '(medium)'}
self.slot_values[sl... | true | true |
f7543a1213624a572b8145ef2cc90ac4735e37a5 | 1,041 | py | Python | alipay/aop/api/response/AlipayUserElectronicidOutermerchantbarcodeCreateResponse.py | snowxmas/alipay-sdk-python-all | 96870ced60facd96c5bce18d19371720cbda3317 | [
"Apache-2.0"
] | 213 | 2018-08-27T16:49:32.000Z | 2021-12-29T04:34:12.000Z | alipay/aop/api/response/AlipayUserElectronicidOutermerchantbarcodeCreateResponse.py | snowxmas/alipay-sdk-python-all | 96870ced60facd96c5bce18d19371720cbda3317 | [
"Apache-2.0"
] | 29 | 2018-09-29T06:43:00.000Z | 2021-09-02T03:27:32.000Z | alipay/aop/api/response/AlipayUserElectronicidOutermerchantbarcodeCreateResponse.py | snowxmas/alipay-sdk-python-all | 96870ced60facd96c5bce18d19371720cbda3317 | [
"Apache-2.0"
] | 59 | 2018-08-27T16:59:26.000Z | 2022-03-25T10:08:15.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.response.AlipayResponse import AlipayResponse
class AlipayUserElectronicidOutermerchantbarcodeCreateResponse(AlipayResponse):
def __init__(self):
super(AlipayUserElectronicidOutermerchantbarcodeCreateResponse, self).__init__()... | 28.916667 | 129 | 0.701249 |
import json
from alipay.aop.api.response.AlipayResponse import AlipayResponse
class AlipayUserElectronicidOutermerchantbarcodeCreateResponse(AlipayResponse):
def __init__(self):
super(AlipayUserElectronicidOutermerchantbarcodeCreateResponse, self).__init__()
self._barcode = None
self._... | true | true |
f7543a3d4f27f9ebe1fdebe9b9d70c7e16b6f33f | 10,602 | py | Python | sdk/lusid/models/holdings_adjustment.py | slemasne/lusid-sdk-python-preview | 94a97951ec2052bc1672b7be21e52ad2fcf6eea0 | [
"MIT"
] | null | null | null | sdk/lusid/models/holdings_adjustment.py | slemasne/lusid-sdk-python-preview | 94a97951ec2052bc1672b7be21e52ad2fcf6eea0 | [
"MIT"
] | null | null | null | sdk/lusid/models/holdings_adjustment.py | slemasne/lusid-sdk-python-preview | 94a97951ec2052bc1672b7be21e52ad2fcf6eea0 | [
"MIT"
] | null | null | null | # coding: utf-8
"""
LUSID API
FINBOURNE Technology # noqa: E501
The version of the OpenAPI document: 0.11.3725
Contact: info@finbourne.com
Generated by: https://openapi-generator.tech
"""
try:
from inspect import getfullargspec
except ImportError:
from inspect import getargspec as getf... | 38.274368 | 343 | 0.649972 |
try:
from inspect import getfullargspec
except ImportError:
from inspect import getargspec as getfullargspec
import pprint
import re
import six
from lusid.configuration import Configuration
class HoldingsAdjustment(object):
openapi_types = {
'effective_at': 'datetime',
'version': '... | true | true |
f7543a7606ebd5f26a9916506ef04c6aaa98de0b | 778 | py | Python | scheduler/models/__init__.py | bethlakshmi/gbe-divio-djangocms-python2.7 | 6e9b2c894162524bbbaaf73dcbe927988707231d | [
"Apache-2.0"
] | 1 | 2021-03-14T11:56:47.000Z | 2021-03-14T11:56:47.000Z | scheduler/models/__init__.py | bethlakshmi/gbe-divio-djangocms-python2.7 | 6e9b2c894162524bbbaaf73dcbe927988707231d | [
"Apache-2.0"
] | 180 | 2019-09-15T19:52:46.000Z | 2021-11-06T23:48:01.000Z | scheduler/models/__init__.py | bethlakshmi/gbe-divio-djangocms-python2.7 | 6e9b2c894162524bbbaaf73dcbe927988707231d | [
"Apache-2.0"
] | null | null | null | from .resource import Resource
from .resource_item import ResourceItem
from .location_item import LocationItem
from .location import Location
from .worker_item import WorkerItem
from .worker import Worker
from .schedulable import Schedulable
from .event_item import EventItem
from .event import Event
from .resource_allo... | 35.363636 | 51 | 0.863753 | from .resource import Resource
from .resource_item import ResourceItem
from .location_item import LocationItem
from .location import Location
from .worker_item import WorkerItem
from .worker import Worker
from .schedulable import Schedulable
from .event_item import EventItem
from .event import Event
from .resource_allo... | true | true |
f7543b8da82fe5222bda7e99249205fd9ef2e64e | 11,536 | py | Python | torch/nn/modules/lazy.py | MagiaSN/pytorch | 7513455c743d3d644b45a804902c1a0d14b69f45 | [
"Intel"
] | 1 | 2021-04-11T08:27:46.000Z | 2021-04-11T08:27:46.000Z | torch/nn/modules/lazy.py | MagiaSN/pytorch | 7513455c743d3d644b45a804902c1a0d14b69f45 | [
"Intel"
] | 1 | 2022-01-18T12:17:29.000Z | 2022-01-18T12:17:29.000Z | torch/nn/modules/lazy.py | MagiaSN/pytorch | 7513455c743d3d644b45a804902c1a0d14b69f45 | [
"Intel"
] | 2 | 2021-07-02T10:18:21.000Z | 2021-08-18T10:10:28.000Z | import itertools
from typing_extensions import Protocol
import warnings
import torch
from ..parameter import is_lazy
class _LazyProtocol(Protocol):
"""This is to avoid errors with mypy checks for
The attributes in a mixin:
https://mypy.readthedocs.io/en/latest/more_types.html#mixin-classes
"""
de... | 44.030534 | 116 | 0.635489 | import itertools
from typing_extensions import Protocol
import warnings
import torch
from ..parameter import is_lazy
class _LazyProtocol(Protocol):
def _register_load_state_dict_pre_hook(self, hook):
...
def register_forward_pre_hook(self, hook):
...
def _lazy_load_hook(
sel... | true | true |
f7543c68e14e24782ccdca17860c7773fb8c430f | 3,243 | py | Python | ckan_ttnmapper_updater/__init__.py | robputt796/ckan-ttnmapper-updater | 0fa3cee8ca779e8dbe1a69680439fd0a5935eaf0 | [
"Apache-2.0"
] | null | null | null | ckan_ttnmapper_updater/__init__.py | robputt796/ckan-ttnmapper-updater | 0fa3cee8ca779e8dbe1a69680439fd0a5935eaf0 | [
"Apache-2.0"
] | null | null | null | ckan_ttnmapper_updater/__init__.py | robputt796/ckan-ttnmapper-updater | 0fa3cee8ca779e8dbe1a69680439fd0a5935eaf0 | [
"Apache-2.0"
] | null | null | null | import json
import logging
import os
import requests
import sys
from requests_toolbelt.multipart.encoder import MultipartEncoder
logging.basicConfig(format='%(asctime)s %(levelname)s: %(message)s',
level=logging.INFO,
stream=sys.stdout)
TTNMAPPER_URL = "https://www... | 32.108911 | 79 | 0.597903 | import json
import logging
import os
import requests
import sys
from requests_toolbelt.multipart.encoder import MultipartEncoder
logging.basicConfig(format='%(asctime)s %(levelname)s: %(message)s',
level=logging.INFO,
stream=sys.stdout)
TTNMAPPER_URL = "https://www... | true | true |
f7543cb3e45f0975ed5967c2c4d175c04c685b2c | 5,352 | py | Python | kubernetes_asyncio/client/models/v1_secret_key_selector.py | weltonrodrigo/kubernetes_asyncio | b793f3e9ea43cbd0f4ff40ace1b0b677682f4042 | [
"Apache-2.0"
] | null | null | null | kubernetes_asyncio/client/models/v1_secret_key_selector.py | weltonrodrigo/kubernetes_asyncio | b793f3e9ea43cbd0f4ff40ace1b0b677682f4042 | [
"Apache-2.0"
] | 13 | 2021-04-12T02:03:48.000Z | 2022-03-28T02:08:46.000Z | kubernetes_asyncio/client/models/v1_secret_key_selector.py | weltonrodrigo/kubernetes_asyncio | b793f3e9ea43cbd0f4ff40ace1b0b677682f4042 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: v1.16.14
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
f... | 29.733333 | 133 | 0.59006 |
import pprint
import re
import six
from kubernetes_asyncio.client.configuration import Configuration
class V1SecretKeySelector(object):
openapi_types = {
'key': 'str',
'name': 'str',
'optional': 'bool'
}
attribute_map = {
'key': 'key',
'name': 'name',
... | true | true |
f7543e5ada3389bd09767736135e81c00254ec7b | 10,135 | py | Python | src/run_utils.py | Alenichel/CodiglioniNichelini_recsys-polimi-2019 | ca97e71da7612644833c20155a0d4d3a57850527 | [
"MIT"
] | null | null | null | src/run_utils.py | Alenichel/CodiglioniNichelini_recsys-polimi-2019 | ca97e71da7612644833c20155a0d4d3a57850527 | [
"MIT"
] | null | null | null | src/run_utils.py | Alenichel/CodiglioniNichelini_recsys-polimi-2019 | ca97e71da7612644833c20155a0d4d3a57850527 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import os
from enum import Enum
import numpy as np
import scipy.sparse as sps
from sklearn.preprocessing import LabelEncoder
from tqdm import tqdm, trange
from cython_modules.leave_one_out import train_test_loo_split as __train_test_loo_split_cython
from csv_utils import load_csv, export_csv
fro... | 35.437063 | 125 | 0.712087 |
import os
from enum import Enum
import numpy as np
import scipy.sparse as sps
from sklearn.preprocessing import LabelEncoder
from tqdm import tqdm, trange
from cython_modules.leave_one_out import train_test_loo_split as __train_test_loo_split_cython
from csv_utils import load_csv, export_csv
from multiprocessing impo... | true | true |
f7543ebffd38c3ba084e7437c65e86cec902cf32 | 4,301 | py | Python | estimagic/optimization/broadcast_arguments.py | yradeva93/estimagic | 77d840ba01748314b35be8117c99460a1944062f | [
"BSD-3-Clause"
] | null | null | null | estimagic/optimization/broadcast_arguments.py | yradeva93/estimagic | 77d840ba01748314b35be8117c99460a1944062f | [
"BSD-3-Clause"
] | null | null | null | estimagic/optimization/broadcast_arguments.py | yradeva93/estimagic | 77d840ba01748314b35be8117c99460a1944062f | [
"BSD-3-Clause"
] | null | null | null | from pathlib import Path
def broadcast_arguments(**arguments):
"""Broadcast arguments.
All passed keyword arguments are broadcasted to the argument with the most elements.
If `n` is the maximum number of elements per keyword arguments, single elements are
duplicated `n`-times. Arguments with `n` ele... | 32.583333 | 88 | 0.615206 | from pathlib import Path
def broadcast_arguments(**arguments):
dict_args = [
"criterion_kwargs",
"algo_options",
"derivative_kwargs",
"criterion_and_derivative_kwargs",
"numdiff_options",
"log_options",
"error_penalty",
]
for arg in dict_args:
... | true | true |
f7543febde83455ecb1db1a1e090d6aa6df844d9 | 6,913 | py | Python | aiocoap/plumbingrequest.py | mguc/aiocoap | a130965a32301a49f77461729b325bc8ed9548bf | [
"MIT"
] | null | null | null | aiocoap/plumbingrequest.py | mguc/aiocoap | a130965a32301a49f77461729b325bc8ed9548bf | [
"MIT"
] | null | null | null | aiocoap/plumbingrequest.py | mguc/aiocoap | a130965a32301a49f77461729b325bc8ed9548bf | [
"MIT"
] | null | null | null | # This file is part of the Python aiocoap library project.
#
# Copyright (c) 2012-2014 Maciej Wasilak <http://sixpinetrees.blogspot.com/>,
# 2013-2014 Christian Amsüss <c.amsuess@energyharvesting.at>
#
# aiocoap is free software, this file is published under the MIT license as
# described in the accompany... | 44.314103 | 182 | 0.691885 |
from collections import namedtuple
import functools
class PlumbingRequest:
Event = namedtuple("Event", ("message", "exception", "is_last"))
def __init__(self, request, log):
self.request = request
self.log = log
self._event_callbacks = []
def __repr__(self):
... | true | true |
f7544084e7df1a9f63754b0c589788c012189b37 | 1,370 | py | Python | PR_BCI_team/Team_StarLab/DKHan/examples/Deep_Learning_Models/OpenBMI_dataset/Preprocessing/convert_gigamne_to_smt.py | PatternRecognition/OpenBMI | d9291ddb81f4319fb3764d7192e0363939a62ee9 | [
"MIT"
] | 217 | 2015-11-02T11:10:29.000Z | 2022-03-22T07:01:12.000Z | PR_BCI_team/Team_StarLab/DKHan/examples/Deep_Learning_Models/Preprocessing/convert_gigamne_to_smt.py | deep-bci-g/OpenBMI | 75daf901b2dbe215852cbff243606dcfcd10f05c | [
"MIT"
] | 24 | 2015-11-02T11:10:45.000Z | 2021-09-08T11:10:33.000Z | PR_BCI_team/Team_StarLab/DKHan/examples/Deep_Learning_Models/Preprocessing/convert_gigamne_to_smt.py | deep-bci-g/OpenBMI | 75daf901b2dbe215852cbff243606dcfcd10f05c | [
"MIT"
] | 112 | 2016-01-22T01:45:44.000Z | 2022-03-22T07:08:19.000Z | import scipy.io as sio
import numpy as np
import os
import mne
import gigadata
import matplotlib.pyplot as plt
from sklearn.discriminant_analysis import LinearDiscriminantAnalysis
from sklearn.model_selection import ShuffleSplit, cross_val_score
from pyriemann.estimation import Covariances
from mne import Epochs, p... | 24.035088 | 79 | 0.678832 | import scipy.io as sio
import numpy as np
import os
import mne
import gigadata
import matplotlib.pyplot as plt
from sklearn.discriminant_analysis import LinearDiscriminantAnalysis
from sklearn.model_selection import ShuffleSplit, cross_val_score
from pyriemann.estimation import Covariances
from mne import Epochs, p... | true | true |
f75440986efbe9ae69423db68a78c52c8e7604a4 | 1,249 | py | Python | tradgram/chatrooms/views.py | didils/tradgram | 4868ca082ab78a1b5b96f25ee9f958567bd1bb1e | [
"MIT"
] | null | null | null | tradgram/chatrooms/views.py | didils/tradgram | 4868ca082ab78a1b5b96f25ee9f958567bd1bb1e | [
"MIT"
] | 4 | 2020-06-05T20:21:46.000Z | 2021-09-08T00:57:42.000Z | tradgram/chatrooms/views.py | didils/tradgram | 4868ca082ab78a1b5b96f25ee9f958567bd1bb1e | [
"MIT"
] | null | null | null | from rest_framework.views import APIView
from rest_framework.response import Response
from rest_framework import status
from . import models, serializers
from django.db.models import Q
class ListAllChatRooms(APIView):
def get(self, request, format=None):
user = request.query_params.get('username', None) ... | 32.868421 | 107 | 0.633307 | from rest_framework.views import APIView
from rest_framework.response import Response
from rest_framework import status
from . import models, serializers
from django.db.models import Q
class ListAllChatRooms(APIView):
def get(self, request, format=None):
user = request.query_params.get('username', None) ... | true | true |
f754415af398b7eb97710931c1ce5761e664f879 | 1,917 | py | Python | scripts/clang-tools/run-clang-tools.py | jainsakshi2395/linux | 7ccb860232bb83fb60cd6bcf5aaf0c008d903acb | [
"Linux-OpenIB"
] | 44 | 2022-03-16T08:32:31.000Z | 2022-03-31T16:02:35.000Z | kernel/scripts/clang-tools/run-clang-tools.py | SFIP/SFIP | e428a425d2d0e287f23d49f3dd583617ebd2e4a3 | [
"Zlib"
] | 1 | 2022-03-29T02:30:28.000Z | 2022-03-30T03:40:46.000Z | kernel/scripts/clang-tools/run-clang-tools.py | SFIP/SFIP | e428a425d2d0e287f23d49f3dd583617ebd2e4a3 | [
"Zlib"
] | 18 | 2022-03-19T04:41:04.000Z | 2022-03-31T03:32:12.000Z | #!/usr/bin/env python3
# SPDX-License-Identifier: GPL-2.0
#
# Copyright (C) Google LLC, 2020
#
# Author: Nathan Huckleberry <nhuck@google.com>
#
"""A helper routine run clang-tidy and the clang static-analyzer on
compile_commands.json.
"""
import argparse
import json
import multiprocessing
import os
import subprocess
... | 25.56 | 78 | 0.6265 |
import argparse
import json
import multiprocessing
import os
import subprocess
import sys
def parse_arguments():
usage = """Run clang-tidy or the clang static-analyzer on a
compilation database."""
parser = argparse.ArgumentParser(description=usage)
type_help = "Type of analysis to be per... | true | true |
f754427de78981a6ffc574ee4a1f45b69e158aa9 | 3,812 | py | Python | cookbook/recipes/plugins/k8s_spark/pyspark_pi.py | pmahindrakar-oss/flytesnacks | 42fcf74f04d50f2527f6f13be72b36ef62e5b7f0 | [
"Apache-2.0"
] | null | null | null | cookbook/recipes/plugins/k8s_spark/pyspark_pi.py | pmahindrakar-oss/flytesnacks | 42fcf74f04d50f2527f6f13be72b36ef62e5b7f0 | [
"Apache-2.0"
] | null | null | null | cookbook/recipes/plugins/k8s_spark/pyspark_pi.py | pmahindrakar-oss/flytesnacks | 42fcf74f04d50f2527f6f13be72b36ef62e5b7f0 | [
"Apache-2.0"
] | null | null | null | """
.. _intermediate_using_spark_tasks:
Creating spark tasks as part of your workflow OR running spark jobs
------------------------------------------------------------------------
This example shows how flytekit simplifies usage of pyspark in a users code.
The task ``hello_spark`` runs a new spark cluster, which whe... | 38.505051 | 206 | 0.703305 | import datetime
import random
from operator import add
import flytekit
from flytekit import task, workflow
from flytekitplugins.spark import Spark
from recipes.plugins.k8s_spark.dataframe_passing import CONTAINER_TEMPLATE
@task(
task_config=Spark(
spark_conf={
"spark.driver.... | true | true |
f754437b201a22d161c136e60dffe303b0a341a2 | 22,998 | py | Python | python/aswfdocker/tests/test_builder.py | boberfly/aswf-docker | 96fa383baa4584b0d389df4759b7cdb832a57873 | [
"Apache-2.0"
] | 3 | 2019-07-02T20:05:35.000Z | 2021-09-14T17:35:25.000Z | python/aswfdocker/tests/test_builder.py | boberfly/aswf-docker | 96fa383baa4584b0d389df4759b7cdb832a57873 | [
"Apache-2.0"
] | null | null | null | python/aswfdocker/tests/test_builder.py | boberfly/aswf-docker | 96fa383baa4584b0d389df4759b7cdb832a57873 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) Contributors to the aswf-docker Project. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
"""
Tests for the build command
"""
import os
import unittest
import logging
import tempfile
from click.testing import CliRunner
from aswfdocker import builder, aswfinfo, index, constants, groupinfo
fr... | 41.512635 | 110 | 0.454953 |
import os
import unittest
import logging
import tempfile
from click.testing import CliRunner
from aswfdocker import builder, aswfinfo, index, constants, groupinfo
from aswfdocker.cli import aswfdocker
class TestBuilder(unittest.TestCase):
def setUp(self):
self.maxDiff = None
self.build_info =... | true | true |
f75444b080584cd9c23f6e0a834fecd29d4067a0 | 1,315 | py | Python | tool/JwtAuth.py | bw98/webservice-1 | 29fdae2e5db3806bdb828869c86bba31a26615a9 | [
"MIT"
] | null | null | null | tool/JwtAuth.py | bw98/webservice-1 | 29fdae2e5db3806bdb828869c86bba31a26615a9 | [
"MIT"
] | null | null | null | tool/JwtAuth.py | bw98/webservice-1 | 29fdae2e5db3806bdb828869c86bba31a26615a9 | [
"MIT"
] | null | null | null | import jwt
import datetime
from jwt import exceptions
def createToken(payload, timeout=20) -> str:
"""
:param payload: 例如:{'user_id':1,'username':'whw'}用户信息
:param timeout: token的过期时间,默认20分钟
:return:
"""
headers = {
'typ': 'jwt',
'alg': 'HS256'
}
payload['exp'] = datet... | 25.784314 | 87 | 0.626616 | import jwt
import datetime
from jwt import exceptions
def createToken(payload, timeout=20) -> str:
headers = {
'typ': 'jwt',
'alg': 'HS256'
}
payload['exp'] = datetime.datetime.utcnow() + datetime.timedelta(minutes=timeout)
key = "laiweifeng233"
algorithm = "HS256"
result = jwt... | true | true |
f754452c021e5299f3b9cf525ae78ae28c82e635 | 36,855 | py | Python | scripts/gen_vimdoc.py | ThePrimeagen/neovim | 29fd20cd3ad390385f380e0eee003607aa13f6e1 | [
"Vim"
] | 1 | 2021-12-04T18:52:04.000Z | 2021-12-04T18:52:04.000Z | scripts/gen_vimdoc.py | ThePrimeagen/neovim | 29fd20cd3ad390385f380e0eee003607aa13f6e1 | [
"Vim"
] | null | null | null | scripts/gen_vimdoc.py | ThePrimeagen/neovim | 29fd20cd3ad390385f380e0eee003607aa13f6e1 | [
"Vim"
] | null | null | null | #!/usr/bin/env python3
"""Generates Nvim :help docs from C/Lua docstrings, using Doxygen.
Also generates *.mpack files. To inspect the *.mpack structure:
:new | put=v:lua.vim.inspect(msgpackparse(readfile('runtime/doc/api.mpack')))
Flow:
main
extract_from_xml
fmt_node_as_vimhelp \
... | 33.936464 | 87 | 0.540442 |
import argparse
import os
import re
import sys
import shutil
import textwrap
import subprocess
import collections
import msgpack
from xml.dom import minidom
MIN_PYTHON_VERSION = (3, 5)
if sys.version_info < MIN_PYTHON_VERSION:
print("requires Python {}.{}+".format(*MIN_PYTHON_VERSION))
sys.exit(1)
DEBUG = ... | true | true |
f754465b816cc33e3e7434556687fbcdef6f0a0b | 125 | py | Python | dps/parallel/__init__.py | alcinos/dps | 5467db1216e9f9089376d2c71f524ced2382e4f6 | [
"Apache-2.0"
] | 2 | 2019-12-18T15:32:57.000Z | 2020-11-10T00:23:17.000Z | dps/parallel/__init__.py | alcinos/dps | 5467db1216e9f9089376d2c71f524ced2382e4f6 | [
"Apache-2.0"
] | 1 | 2020-05-02T16:40:59.000Z | 2020-05-02T16:40:59.000Z | dps/parallel/__init__.py | alcinos/dps | 5467db1216e9f9089376d2c71f524ced2382e4f6 | [
"Apache-2.0"
] | 3 | 2019-05-02T15:09:36.000Z | 2020-11-15T10:33:19.000Z | from .base import Operator, Job, ReadOnlyJob
from .object_store import ObjectFragment, FileSystemObjectStore, ZipObjectStore
| 41.666667 | 79 | 0.856 | from .base import Operator, Job, ReadOnlyJob
from .object_store import ObjectFragment, FileSystemObjectStore, ZipObjectStore
| true | true |
f75446ed0f9a5a02b6688b04b31609052fcd0736 | 785 | py | Python | froide/account/migrations/0010_auto_20171011_2152.py | manonthemat/froide | 698c49935eaf2e922f3c9f6a46af0fd545ccbbbb | [
"MIT"
] | null | null | null | froide/account/migrations/0010_auto_20171011_2152.py | manonthemat/froide | 698c49935eaf2e922f3c9f6a46af0fd545ccbbbb | [
"MIT"
] | 3 | 2017-12-08T21:32:01.000Z | 2017-12-09T20:31:53.000Z | froide/account/migrations/0010_auto_20171011_2152.py | ashmpace/question-mtl | 5ce1289cd6db0e629aa138d2dee235d9a4c4546b | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2017-10-11 19:52
from __future__ import unicode_literals
from django.db import migrations
from ..hashers import PBKDF2WrappedSHA1PasswordHasher
def forwards_func(apps, schema_editor):
User = apps.get_model('account', 'User')
users = User.objects.filter... | 27.068966 | 64 | 0.698089 |
from __future__ import unicode_literals
from django.db import migrations
from ..hashers import PBKDF2WrappedSHA1PasswordHasher
def forwards_func(apps, schema_editor):
User = apps.get_model('account', 'User')
users = User.objects.filter(password__startswith='sha1$')
hasher = PBKDF2WrappedSHA1PasswordHa... | true | true |
f754472c7ad3aaab1fc100dc6e3247a4d26aa105 | 649 | py | Python | camera-python/05-streaming/stream_pi.py | ReemDAlsh/camera-python-opencv | 6adb12b682907554645211217e970480685347b0 | [
"BSD-2-Clause"
] | 74 | 2017-08-28T02:42:59.000Z | 2022-02-12T02:11:05.000Z | camera-python/05-streaming/stream_pi.py | ReemDAlsh/camera-python-opencv | 6adb12b682907554645211217e970480685347b0 | [
"BSD-2-Clause"
] | 1 | 2018-02-09T08:50:00.000Z | 2018-02-09T08:50:00.000Z | camera-python/05-streaming/stream_pi.py | ReemDAlsh/camera-python-opencv | 6adb12b682907554645211217e970480685347b0 | [
"BSD-2-Clause"
] | 42 | 2017-08-17T10:25:07.000Z | 2021-07-16T11:07:13.000Z | #!/usr/bin/python
#+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
#|R|a|s|p|b|e|r|r|y|P|i|.|c|o|m|.|t|w|
#+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
# Copyright (c) 2014, raspberrypi.com.tw
# All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
#
# Author : sosorr... | 29.5 | 90 | 0.560863 |
from time import time
class Camera(object):
def __init__(self):
self.frames = [open("static/" + f + '.jpg', 'rb').read() for f in ['1', '2', '3']]
def get_frame(self):
return self.frames[int(time()) % 3]
| true | true |
f754477ee8a1f28dcb55b28d1d929927030fdc4c | 538 | py | Python | test_zc.py | eavanvalkenburg/sia-ha | 9ec5e9329593307609a5f11290ade21c567a5556 | [
"MIT"
] | 49 | 2019-09-09T13:57:01.000Z | 2022-01-17T15:12:09.000Z | test_zc.py | eavanvalkenburg/sia-ha | 9ec5e9329593307609a5f11290ade21c567a5556 | [
"MIT"
] | 44 | 2019-09-11T19:10:05.000Z | 2021-12-21T14:33:35.000Z | test_zc.py | eavanvalkenburg/sia-ha | 9ec5e9329593307609a5f11290ade21c567a5556 | [
"MIT"
] | 12 | 2019-12-13T17:33:31.000Z | 2021-12-21T19:57:46.000Z | from zeroconf import ServiceBrowser, Zeroconf
class MyListener:
def remove_service(self, zeroconf, type, name):
print("Service %s removed" % (name,))
def add_service(self, zeroconf, type, name):
info = zeroconf.get_service_info(type, name)
print("Service %s added, service info: %s" %... | 26.9 | 66 | 0.685874 | from zeroconf import ServiceBrowser, Zeroconf
class MyListener:
def remove_service(self, zeroconf, type, name):
print("Service %s removed" % (name,))
def add_service(self, zeroconf, type, name):
info = zeroconf.get_service_info(type, name)
print("Service %s added, service info: %s" %... | true | true |
f75448560d7eff60c0664fe18b8095836fe7f33b | 2,475 | py | Python | pytorch_sound/data/eng_handler/__init__.py | AppleHolic/pytorch_sound | 2320516d21d70c406d1dee74927e238972c96106 | [
"BSD-2-Clause"
] | 86 | 2019-08-01T04:45:31.000Z | 2021-12-23T07:08:08.000Z | pytorch_sound/data/eng_handler/__init__.py | AppleHolic/pytorch_sound | 2320516d21d70c406d1dee74927e238972c96106 | [
"BSD-2-Clause"
] | 15 | 2019-08-01T00:14:53.000Z | 2020-11-20T16:53:02.000Z | pytorch_sound/data/eng_handler/__init__.py | AppleHolic/pytorch_sound | 2320516d21d70c406d1dee74927e238972c96106 | [
"BSD-2-Clause"
] | 9 | 2019-08-23T18:32:02.000Z | 2022-02-17T07:13:28.000Z | import re
from typing import List, Dict
from pytorch_sound.data.eng_handler import cleaners
from pytorch_sound.data.eng_handler.symbols import symbols
# Mappings from symbol to numeric ID and vice versa:
_symbol_to_id: Dict[str, int] = {s: i for i, s in enumerate(symbols)}
_id_to_symbol: Dict[int, str] = {i: s for i,... | 32.565789 | 96 | 0.654141 | import re
from typing import List, Dict
from pytorch_sound.data.eng_handler import cleaners
from pytorch_sound.data.eng_handler.symbols import symbols
_symbol_to_id: Dict[str, int] = {s: i for i, s in enumerate(symbols)}
_id_to_symbol: Dict[int, str] = {i: s for i, s in enumerate(symbols)}
_curly_re = re.compile(... | true | true |
f754495235a5672cda57cfa5a9fda0b07d68af99 | 8,153 | py | Python | pyfan/amto/array/geomspace.py | FanWangEcon/pyfan | 126e91c0c6d930f1c335a07396d1d2145b247cea | [
"MIT"
] | 1 | 2020-08-02T21:43:39.000Z | 2020-08-02T21:43:39.000Z | pyfan/amto/array/geomspace.py | FanWangEcon/pyfan | 126e91c0c6d930f1c335a07396d1d2145b247cea | [
"MIT"
] | null | null | null | pyfan/amto/array/geomspace.py | FanWangEcon/pyfan | 126e91c0c6d930f1c335a07396d1d2145b247cea | [
"MIT"
] | 1 | 2020-12-02T06:45:20.000Z | 2020-12-02T06:45:20.000Z | '''
Created on May 24, 2018
@author: fan
To have a better grid denser at the beginning
'''
import time as time
import numpy as np
from numba import jit
import logging
logger = logging.getLogger(__name__)
# @vectorize([float64(float64, float64, float64, float64, float64, float64, float64, float64)])
def grid_to_... | 27.921233 | 98 | 0.614988 |
import time as time
import numpy as np
from numba import jit
import logging
logger = logging.getLogger(__name__)
def grid_to_geom_short(choice_grid, choice_grid_max, choice_grid_min,
start, stop, num, geom_ratio, a):
scaler = (choice_grid_max - choice_grid_min) / (stop - start)
__,... | true | true |
f7544953966445dc946abd83a98b9cae5d70464b | 1,740 | py | Python | quarkchain/evm/bloom.py | anshulkusa/pyquarkchain | af80b6fdd331c69ce1bc801caf7c2cdd1e82a435 | [
"MIT"
] | 237 | 2018-09-18T00:47:14.000Z | 2022-03-21T21:43:07.000Z | quarkchain/evm/bloom.py | anshulkusa/pyquarkchain | af80b6fdd331c69ce1bc801caf7c2cdd1e82a435 | [
"MIT"
] | 409 | 2018-09-18T01:02:29.000Z | 2022-01-24T20:51:58.000Z | quarkchain/evm/bloom.py | anshulkusa/pyquarkchain | af80b6fdd331c69ce1bc801caf7c2cdd1e82a435 | [
"MIT"
] | 125 | 2018-09-18T00:47:28.000Z | 2022-03-24T20:00:46.000Z | from quarkchain.utils import sha3_256
from quarkchain.evm import utils
"""
Blooms are the 3-point, 2048-bit (11-bits/point) Bloom filter of each
component (except data) of each log entry of each transaction.
We set the bits of a 2048-bit value whose indices are given by
the low order 11-bits
of the first three double... | 23.513514 | 88 | 0.674713 | from quarkchain.utils import sha3_256
from quarkchain.evm import utils
BUCKETS_PER_VAL = 3
def safe_ord(value):
if isinstance(value, int):
return value
else:
return ord(value)
def bloom(val: bytes):
return bloom_insert(0, val)
def bloom_insert(bloom: int, val: bytes):
h = sha3_25... | true | true |
f75449609b968da28999a1bba9040d3894757566 | 734 | py | Python | tensorflow_datasets/audio/gtzan_music_speech/__init__.py | jvishnuvardhan/datasets | b8e38187058f1221e67c6291b3f29385ebb35fa2 | [
"Apache-2.0"
] | 3,380 | 2018-09-11T05:03:31.000Z | 2022-03-31T20:04:57.000Z | tensorflow_datasets/audio/gtzan_music_speech/__init__.py | jvishnuvardhan/datasets | b8e38187058f1221e67c6291b3f29385ebb35fa2 | [
"Apache-2.0"
] | 3,142 | 2018-09-14T10:09:00.000Z | 2022-03-31T18:25:44.000Z | tensorflow_datasets/audio/gtzan_music_speech/__init__.py | jvishnuvardhan/datasets | b8e38187058f1221e67c6291b3f29385ebb35fa2 | [
"Apache-2.0"
] | 1,438 | 2018-09-16T13:58:22.000Z | 2022-03-31T11:19:54.000Z | # coding=utf-8
# Copyright 2021 The TensorFlow Datasets 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 appl... | 38.631579 | 92 | 0.777929 |
from tensorflow_datasets.audio.gtzan_music_speech.gtzan_music_speech import GTZANMusicSpeech
| true | true |
f7544a4c0eeba3f6e085824492ebc6436e696eeb | 5,541 | py | Python | configs/rfcn/rfcn_r101_caffe_1x_voc0712.py | tf2cvtk/mmdetection | da6768e8543f06bbdda85425f6879d42594d48b0 | [
"Apache-2.0"
] | null | null | null | configs/rfcn/rfcn_r101_caffe_1x_voc0712.py | tf2cvtk/mmdetection | da6768e8543f06bbdda85425f6879d42594d48b0 | [
"Apache-2.0"
] | null | null | null | configs/rfcn/rfcn_r101_caffe_1x_voc0712.py | tf2cvtk/mmdetection | da6768e8543f06bbdda85425f6879d42594d48b0 | [
"Apache-2.0"
] | null | null | null | # model settings
norm_cfg = dict(type='BN', requires_grad=False)
model = dict(
type='RFCN',
pretrained='open-mmlab://resnet101_caffe',
backbone=dict(
type='ResNet',
depth=101,
num_stages=4,
out_indices=(2, 3),
frozen_stages=1,
dilations=(1, 1, 1, 2),
s... | 29.31746 | 78 | 0.586176 |
norm_cfg = dict(type='BN', requires_grad=False)
model = dict(
type='RFCN',
pretrained='open-mmlab://resnet101_caffe',
backbone=dict(
type='ResNet',
depth=101,
num_stages=4,
out_indices=(2, 3),
frozen_stages=1,
dilations=(1, 1, 1, 2),
strides=(1, 2, 2,... | true | true |
f7544cc06a806cf7902382bc081a48224a6c378f | 2,452 | py | Python | ucscsdk/mometa/dupe/DupeIntRequestor.py | parag-may4/ucscsdk | 2ea762fa070330e3a4e2c21b46b157469555405b | [
"Apache-2.0"
] | 9 | 2016-12-22T08:39:25.000Z | 2019-09-10T15:36:19.000Z | ucscsdk/mometa/dupe/DupeIntRequestor.py | parag-may4/ucscsdk | 2ea762fa070330e3a4e2c21b46b157469555405b | [
"Apache-2.0"
] | 10 | 2017-01-31T06:59:56.000Z | 2021-11-09T09:14:37.000Z | ucscsdk/mometa/dupe/DupeIntRequestor.py | parag-may4/ucscsdk | 2ea762fa070330e3a4e2c21b46b157469555405b | [
"Apache-2.0"
] | 13 | 2016-11-14T07:42:58.000Z | 2022-02-10T17:32:05.000Z | """This module contains the general information for DupeIntRequestor ManagedObject."""
from ...ucscmo import ManagedObject
from ...ucsccoremeta import UcscVersion, MoPropertyMeta, MoMeta
from ...ucscmeta import VersionMeta
class DupeIntRequestorConsts():
pass
class DupeIntRequestor(ManagedObject):
"""This ... | 49.04 | 249 | 0.664763 |
from ...ucscmo import ManagedObject
from ...ucsccoremeta import UcscVersion, MoPropertyMeta, MoMeta
from ...ucscmeta import VersionMeta
class DupeIntRequestorConsts():
pass
class DupeIntRequestor(ManagedObject):
consts = DupeIntRequestorConsts()
naming_props = set([u'name'])
mo_meta = MoMeta("Dup... | true | true |
f7544dc3dea542a00f1bf792afe808d74e1ecc54 | 6,171 | py | Python | niftynet/layer/discrete_label_normalisation.py | amh28/NIF | 92a2f447738224fb10b83fa60c78a35e0c25ac34 | [
"Apache-2.0"
] | null | null | null | niftynet/layer/discrete_label_normalisation.py | amh28/NIF | 92a2f447738224fb10b83fa60c78a35e0c25ac34 | [
"Apache-2.0"
] | null | null | null | niftynet/layer/discrete_label_normalisation.py | amh28/NIF | 92a2f447738224fb10b83fa60c78a35e0c25ac34 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, division
import os
import numpy as np
import tensorflow as tf
import niftynet.utilities.histogram_standardisation as hs
from niftynet.layer.base_layer import DataDependentLayer
from niftynet.layer.base_layer import Invertible
from niftyn... | 41.14 | 80 | 0.637822 |
from __future__ import absolute_import, print_function, division
import os
import numpy as np
import tensorflow as tf
import niftynet.utilities.histogram_standardisation as hs
from niftynet.layer.base_layer import DataDependentLayer
from niftynet.layer.base_layer import Invertible
from niftynet.utilities.user_param... | true | true |
f7544dd2d55339cc78d870af64e6a745bd580ede | 458 | py | Python | plataforma/migrations/0010_auto_20160916_1724.py | SurielRuano/Orientador-Legal | a3be31d6019bcf254c3dcbbb26b4ffbbc85a9871 | [
"MIT"
] | null | null | null | plataforma/migrations/0010_auto_20160916_1724.py | SurielRuano/Orientador-Legal | a3be31d6019bcf254c3dcbbb26b4ffbbc85a9871 | [
"MIT"
] | null | null | null | plataforma/migrations/0010_auto_20160916_1724.py | SurielRuano/Orientador-Legal | a3be31d6019bcf254c3dcbbb26b4ffbbc85a9871 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2016-09-16 17:24
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('plataforma', '0009_auto_20160914_1632'),
]
operations = [
migrations.AlterFie... | 21.809524 | 51 | 0.624454 |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('plataforma', '0009_auto_20160914_1632'),
]
operations = [
migrations.AlterField(
model_name='articulo',
name='contenido',
... | true | true |
f7544e3d9bbfd77dfa96b0ca9630d8ea444d821a | 2,074 | py | Python | .travis.py | revenantkoi/Hacktoberfest-1 | de57b59c6fb0b6222ca7fa422e421d842fd4b0d4 | [
"MIT"
] | null | null | null | .travis.py | revenantkoi/Hacktoberfest-1 | de57b59c6fb0b6222ca7fa422e421d842fd4b0d4 | [
"MIT"
] | null | null | null | .travis.py | revenantkoi/Hacktoberfest-1 | de57b59c6fb0b6222ca7fa422e421d842fd4b0d4 | [
"MIT"
] | null | null | null | import json
import os
import re
import subprocess
# Get a diff between master and current.
try:
commit_range = os.environ["TRAVIS_COMMIT_RANGE"]
changed_files = subprocess.check_output(["git", "diff", "--name-only", commit_range])
except KeyError:
print("🔥 This should be run on Travis. Otherwise make sure... | 31.907692 | 123 | 0.66972 | import json
import os
import re
import subprocess
try:
commit_range = os.environ["TRAVIS_COMMIT_RANGE"]
changed_files = subprocess.check_output(["git", "diff", "--name-only", commit_range])
except KeyError:
print("🔥 This should be run on Travis. Otherwise make sure TRAVIS_BRANCH is set.")
exit(1)
c... | true | true |
f7544eb4e823465424b741f328f137c045f6eefc | 228 | py | Python | pychron/hardware/kerr/tests/kerr_motor.py | ael-noblegas/pychron | 6ebbbb1f66a614972b62b7a9be4c784ae61b5d62 | [
"Apache-2.0"
] | 1 | 2019-02-27T21:57:44.000Z | 2019-02-27T21:57:44.000Z | pychron/hardware/kerr/tests/kerr_motor.py | ael-noblegas/pychron | 6ebbbb1f66a614972b62b7a9be4c784ae61b5d62 | [
"Apache-2.0"
] | 80 | 2018-07-17T20:10:20.000Z | 2021-08-17T15:38:24.000Z | pychron/hardware/kerr/tests/kerr_motor.py | AGESLDEO/pychron | 1a81e05d9fba43b797f335ceff6837c016633bcf | [
"Apache-2.0"
] | null | null | null | import unittest
class KerrMotorTestCase(unittest.TestCase):
def test_something(self):
self.assertEqual(True, False)
def test_float_to_hexstr(self):
pass
if __name__ == '__main__':
unittest.main()
| 17.538462 | 43 | 0.692982 | import unittest
class KerrMotorTestCase(unittest.TestCase):
def test_something(self):
self.assertEqual(True, False)
def test_float_to_hexstr(self):
pass
if __name__ == '__main__':
unittest.main()
| true | true |
f7544ec7da5c54a03efb3811e3ccc85087073912 | 270 | py | Python | src/imports/libmodules.py | coallaoh/GuidedLabelling | ff208cf2a06361ccd4f3cca2f092c49664c17be5 | [
"MIT"
] | 42 | 2017-04-26T09:26:35.000Z | 2022-02-28T09:10:33.000Z | src/imports/libmodules.py | coallaoh/GuidedLabelling | ff208cf2a06361ccd4f3cca2f092c49664c17be5 | [
"MIT"
] | 2 | 2017-12-21T03:54:08.000Z | 2021-01-07T11:20:16.000Z | src/imports/libmodules.py | coallaoh/GuidedLabelling | ff208cf2a06361ccd4f3cca2f092c49664c17be5 | [
"MIT"
] | 9 | 2017-11-22T15:27:38.000Z | 2021-01-05T06:42:38.000Z | __author__ = 'joon'
from pascaltools.process import get_pascal_classes, get_pascal_classes_bg
from pascaltools.io import get_pascal_indexlist, load_pascal_annotation, load_pascal_conf
from seedtools.heatmap import heatmap2segconf
from densecrftools.densecrf import CRF
| 38.571429 | 89 | 0.877778 | __author__ = 'joon'
from pascaltools.process import get_pascal_classes, get_pascal_classes_bg
from pascaltools.io import get_pascal_indexlist, load_pascal_annotation, load_pascal_conf
from seedtools.heatmap import heatmap2segconf
from densecrftools.densecrf import CRF
| true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.