hexsha stringlengths 40 40 | size int64 7 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 125 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 368k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 247 | max_issues_repo_name stringlengths 4 125 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 247 | max_forks_repo_name stringlengths 4 125 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 1 1.04M | avg_line_length float64 1.77 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 7 1.04M | filtered:remove_function_no_docstring int64 -102 942k | filtered:remove_class_no_docstring int64 -354 977k | filtered:remove_delete_markers int64 0 60.1k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
192bb8607963af6b3ec3475a387a23da8f5fe9fe | 8,292 | py | Python | ProtoDeclare.py | colutto/X3DOM_database_Integration | 34860d00ff9851d66355fabc1697180cb961440c | [
"MIT"
] | null | null | null | ProtoDeclare.py | colutto/X3DOM_database_Integration | 34860d00ff9851d66355fabc1697180cb961440c | [
"MIT"
] | null | null | null | ProtoDeclare.py | colutto/X3DOM_database_Integration | 34860d00ff9851d66355fabc1697180cb961440c | [
"MIT"
] | null | null | null | import database
MAX_HEIGHT = 7 # maximum cupoid size in the diagram
# the protoDeclare class represents one whole protoDeclare tag in the html file
# the class saves the field nodes, appearance, form and the shape of the protoDeclare node.
# the class represents the field values in the protoDeclare class | 55.651007 | 106 | 0.649542 | import database
MAX_HEIGHT = 7 # maximum cupoid size in the diagram
# the protoDeclare class represents one whole protoDeclare tag in the html file
# the class saves the field nodes, appearance, form and the shape of the protoDeclare node.
class ProtoDeclare:
def __init__(self, interface, body, soup):
# i... | 7,705 | -11 | 285 |
cd8387f643d30a645f723ac742fcfa51c4d14cc6 | 5,601 | py | Python | train_eval.py | hsdong2012/PTL | 699d47b85813cc053ac03acaf4395d2b8f5922e7 | [
"MIT"
] | 24 | 2019-08-08T02:28:58.000Z | 2022-01-18T09:08:08.000Z | train_eval.py | xujinglin/PTL | 699d47b85813cc053ac03acaf4395d2b8f5922e7 | [
"MIT"
] | 2 | 2019-08-13T01:06:49.000Z | 2020-07-11T14:17:50.000Z | train_eval.py | xujinglin/PTL | 699d47b85813cc053ac03acaf4395d2b8f5922e7 | [
"MIT"
] | 7 | 2019-08-18T10:57:28.000Z | 2022-02-05T06:21:24.000Z | import numpy as np
from scipy.spatial.distance import cdist
import torch
import os
from torch.optim import Adam, lr_scheduler
from opt import opt
from data import Data
from mgn_ptl import MGN_PTL
from mgn import MGN
from loss import Loss
from functions import mean_ap, cmc, re_ranking
if __name__ == '__main__':
as... | 36.848684 | 118 | 0.589002 | import numpy as np
from scipy.spatial.distance import cdist
import torch
import os
from torch.optim import Adam, lr_scheduler
from opt import opt
from data import Data
from mgn_ptl import MGN_PTL
from mgn import MGN
from loss import Loss
from functions import mean_ap, cmc, re_ranking
def usegpu(element):
if opt.us... | 3,962 | 189 | 46 |
1b4edb64c6cb9dec303be91cb78c4f39cb0218db | 4,885 | py | Python | ionyweb/administration/tests/website.py | makinacorpus/ionyweb | 2f18e3dc1fdc86c7e19bae3778e67e28a37567be | [
"BSD-3-Clause"
] | 4 | 2015-09-28T10:07:39.000Z | 2019-10-18T20:14:07.000Z | ionyweb/administration/tests/website.py | makinacorpus/ionyweb | 2f18e3dc1fdc86c7e19bae3778e67e28a37567be | [
"BSD-3-Clause"
] | 1 | 2021-03-19T21:41:33.000Z | 2021-03-19T21:41:33.000Z | ionyweb/administration/tests/website.py | makinacorpus/ionyweb | 2f18e3dc1fdc86c7e19bae3778e67e28a37567be | [
"BSD-3-Clause"
] | 1 | 2017-10-12T09:25:19.000Z | 2017-10-12T09:25:19.000Z | # -*- coding: utf-8 -*-
from django.conf import settings
from django.contrib.sites.models import Site
from ionyweb.administration.tests import test_reverse, AdministrationTests
from time import time
| 35.919118 | 75 | 0.63521 | # -*- coding: utf-8 -*-
from django.conf import settings
from django.contrib.sites.models import Site
from ionyweb.administration.tests import test_reverse, AdministrationTests
from time import time
class WebsiteViewTests(AdministrationTests):
def test_domains_view(self):
url = test_reverse('wa-domains')... | 4,504 | 23 | 158 |
1084db5a025707a35090ae1d7b2a518096985145 | 79 | py | Python | tests/test_decorators.py | gregchagnon/orm.cloud | c783480eef38c032194eec29e4bb3b406f787cd6 | [
"Apache-2.0"
] | null | null | null | tests/test_decorators.py | gregchagnon/orm.cloud | c783480eef38c032194eec29e4bb3b406f787cd6 | [
"Apache-2.0"
] | 17 | 2019-06-04T02:15:52.000Z | 2019-06-20T01:03:10.000Z | tests/test_decorators.py | gregchagnon/orm.cloud | c783480eef38c032194eec29e4bb3b406f787cd6 | [
"Apache-2.0"
] | null | null | null | from tests.thing import Thing
thing = Thing()
a = thing.__dict__
thing.test()
| 13.166667 | 29 | 0.734177 | from tests.thing import Thing
thing = Thing()
a = thing.__dict__
thing.test()
| 0 | 0 | 0 |
822b8dd349ae880d2ecafd28949138fd00db85b4 | 19,197 | py | Python | src/GaIA/pkgs/nmap/nmap-6.40/zenmap/zenmapGUI/NmapOutputProperties.py | uninth/UNItools | c8b1fbfd5d3753b5b14fa19033e39737dedefc00 | [
"BSD-3-Clause"
] | null | null | null | src/GaIA/pkgs/nmap/nmap-6.40/zenmap/zenmapGUI/NmapOutputProperties.py | uninth/UNItools | c8b1fbfd5d3753b5b14fa19033e39737dedefc00 | [
"BSD-3-Clause"
] | null | null | null | src/GaIA/pkgs/nmap/nmap-6.40/zenmap/zenmapGUI/NmapOutputProperties.py | uninth/UNItools | c8b1fbfd5d3753b5b14fa19033e39737dedefc00 | [
"BSD-3-Clause"
] | 1 | 2021-06-08T15:59:26.000Z | 2021-06-08T15:59:26.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# ***********************IMPORTANT NMAP LICENSE TERMS************************
# * *
# * The Nmap Security Scanner is (C) 1996-2013 Insecure.Com LLC. Nmap is *
# * also a registered trademark of Inse... | 49.992188 | 97 | 0.598427 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# ***********************IMPORTANT NMAP LICENSE TERMS************************
# * *
# * The Nmap Security Scanner is (C) 1996-2013 Insecure.Com LLC. Nmap is *
# * also a registered trademark of Inse... | 8,216 | 1,026 | 153 |
51993e54c622702bdc81472acb58d47809a411aa | 7,839 | py | Python | python/federatedml/protobuf/generated/hetero_kmeans_param_pb2.py | rubenlozanoaht3m/DataDogm | cd605e8072cca31e8418830c3300657ae2fa5b16 | [
"Apache-2.0"
] | 715 | 2019-01-24T10:52:03.000Z | 2019-10-31T12:19:22.000Z | python/federatedml/protobuf/generated/hetero_kmeans_param_pb2.py | rubenlozanoaht3m/DataDogm | cd605e8072cca31e8418830c3300657ae2fa5b16 | [
"Apache-2.0"
] | 270 | 2019-02-11T02:57:36.000Z | 2019-08-29T11:22:33.000Z | python/federatedml/protobuf/generated/hetero_kmeans_param_pb2.py | rubenlozanoaht3m/DataDogm | cd605e8072cca31e8418830c3300657ae2fa5b16 | [
"Apache-2.0"
] | 200 | 2019-01-26T14:21:35.000Z | 2019-11-01T01:14:36.000Z | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: hetero-kmeans-param.proto
import sys
_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from g... | 42.836066 | 708 | 0.713611 | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: hetero-kmeans-param.proto
import sys
_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from g... | 0 | 0 | 0 |
c4ebf9a8b5311d74a00a03dc746e0c0c7758150d | 1,481 | py | Python | backend/userauth/serializers.py | daeisbae/PeerOrgan-HackNYU2022 | 3f11f80fe101800727743e348ccb4f9135198950 | [
"MIT"
] | null | null | null | backend/userauth/serializers.py | daeisbae/PeerOrgan-HackNYU2022 | 3f11f80fe101800727743e348ccb4f9135198950 | [
"MIT"
] | null | null | null | backend/userauth/serializers.py | daeisbae/PeerOrgan-HackNYU2022 | 3f11f80fe101800727743e348ccb4f9135198950 | [
"MIT"
] | null | null | null | from rest_framework import serializers
from django.contrib.auth.models import User
from . import models
| 28.480769 | 98 | 0.632005 | from rest_framework import serializers
from django.contrib.auth.models import User
from . import models
class DonorSerializer(serializers.ModelSerializer):
class Meta:
model = models.Donor
exclude = ('user',)
class RecipientSerializer(serializers.ModelSerializer):
class Meta:
... | 686 | 587 | 98 |
bc716f2fdcd1be701c5594a8b27d728a55a65896 | 1,160 | py | Python | 1_bell_dokumentation_(paper)/pretty_code/visualize_data.py | pitizzzle/paper-3d-computer-stereo-vision | 946e6f9d8d53e8e80baf3165e3c4f463b1ab1a45 | [
"MIT"
] | 1 | 2021-07-01T12:32:32.000Z | 2021-07-01T12:32:32.000Z | 1_bell_dokumentation_(paper)/pretty_code/visualize_data.py | pitizzzle/3d-computer-stereo-vision | 946e6f9d8d53e8e80baf3165e3c4f463b1ab1a45 | [
"MIT"
] | null | null | null | 1_bell_dokumentation_(paper)/pretty_code/visualize_data.py | pitizzzle/3d-computer-stereo-vision | 946e6f9d8d53e8e80baf3165e3c4f463b1ab1a45 | [
"MIT"
] | null | null | null | # --TASK-- visualize located objects based on datafile
import bpy, json
from calibration import get_calibration
from generate_mesh import generate_mesh
# load data
data_file = open('<source_datafile_path>', 'r')
data = json.loads(data_file.read())
data_file.close()
# iterate frames in data
for frame_coun... | 29 | 98 | 0.675862 | # --TASK-- visualize located objects based on datafile
import bpy, json
from calibration import get_calibration
from generate_mesh import generate_mesh
# load data
data_file = open('<source_datafile_path>', 'r')
data = json.loads(data_file.read())
data_file.close()
# iterate frames in data
for frame_coun... | 0 | 0 | 0 |
f3aa39200a91e8ee89c1f49153a1bf66342a6c27 | 1,666 | py | Python | tests/functional/parser/schemas.py | n2N8Z/aws-lambda-powertools-python | 0cb5d506f534ac76b42f2d5959d93c7b2bb4d8e9 | [
"MIT-0"
] | null | null | null | tests/functional/parser/schemas.py | n2N8Z/aws-lambda-powertools-python | 0cb5d506f534ac76b42f2d5959d93c7b2bb4d8e9 | [
"MIT-0"
] | null | null | null | tests/functional/parser/schemas.py | n2N8Z/aws-lambda-powertools-python | 0cb5d506f534ac76b42f2d5959d93c7b2bb4d8e9 | [
"MIT-0"
] | null | null | null | from typing import Dict, List, Optional
from pydantic import BaseModel
from typing_extensions import Literal
from aws_lambda_powertools.utilities.parser.models import (
DynamoDBStreamChangedRecordModel,
DynamoDBStreamModel,
DynamoDBStreamRecordModel,
EventBridgeModel,
SnsModel,
SnsNotification... | 19.833333 | 61 | 0.779712 | from typing import Dict, List, Optional
from pydantic import BaseModel
from typing_extensions import Literal
from aws_lambda_powertools.utilities.parser.models import (
DynamoDBStreamChangedRecordModel,
DynamoDBStreamModel,
DynamoDBStreamRecordModel,
EventBridgeModel,
SnsModel,
SnsNotification... | 0 | 923 | 345 |
6181a7e0b3ce93cd812e3bae373f3d1e4e6dde84 | 153 | py | Python | tweetpie/credential.py | query-me/tweetpie | d491cc6caf5a6a6575d1d11ec7e7a12bea53fa95 | [
"MIT"
] | null | null | null | tweetpie/credential.py | query-me/tweetpie | d491cc6caf5a6a6575d1d11ec7e7a12bea53fa95 | [
"MIT"
] | null | null | null | tweetpie/credential.py | query-me/tweetpie | d491cc6caf5a6a6575d1d11ec7e7a12bea53fa95 | [
"MIT"
] | null | null | null | import dataclasses
@dataclasses.dataclass | 17 | 24 | 0.75817 | import dataclasses
@dataclasses.dataclass
class Credential:
consumer_key: str
consumer_secret: str
access_token: str
access_secret: str | 0 | 89 | 22 |
c9b68acb36ca59601f303861980dd42bddb48193 | 2,693 | py | Python | Code/Cryptography/Vigenere Cipher.py | BambooFlower/Math-Scripts | ee89c4f8a1fe80f355e2daa0baa4f94374ee3ab5 | [
"MIT"
] | 3 | 2020-03-10T13:21:24.000Z | 2020-12-20T19:52:53.000Z | Code/Cryptography/Vigenere Cipher.py | BambooFlower/Math-Scripts | ee89c4f8a1fe80f355e2daa0baa4f94374ee3ab5 | [
"MIT"
] | 1 | 2020-07-25T14:25:08.000Z | 2020-07-25T14:28:07.000Z | Code/Cryptography/Vigenere Cipher.py | BambooFlower/Math-Scripts | ee89c4f8a1fe80f355e2daa0baa4f94374ee3ab5 | [
"MIT"
] | 3 | 2020-07-25T13:17:29.000Z | 2020-10-22T15:11:25.000Z | # This is a python implementation of the Vigenere Cipher, it employs a form of polyalphabetic substitution and remained unbreakable for three centuries
# Reference can be found at: https://en.wikipedia.org/wiki/Vigen%C3%A8re_cipher
# In this implementaion we will use the keyword: LEMON
import math
# Examples:
... | 31.682353 | 152 | 0.650576 | # This is a python implementation of the Vigenere Cipher, it employs a form of polyalphabetic substitution and remained unbreakable for three centuries
# Reference can be found at: https://en.wikipedia.org/wiki/Vigen%C3%A8re_cipher
# In this implementaion we will use the keyword: LEMON
import math
def encryption():... | 2,298 | 0 | 46 |
dfcd9a86d95b1e768792a1d8216a0c92f28c379d | 29,155 | py | Python | zrna/api.py | zrna-research/zrna-api | 16a4fa981e5e21202a0ad78a9b18ffa298ef17d0 | [
"Apache-2.0"
] | 31 | 2019-07-30T20:59:03.000Z | 2021-07-26T21:16:18.000Z | zrna/api.py | zrna-research/zrna-api | 16a4fa981e5e21202a0ad78a9b18ffa298ef17d0 | [
"Apache-2.0"
] | null | null | null | zrna/api.py | zrna-research/zrna-api | 16a4fa981e5e21202a0ad78a9b18ffa298ef17d0 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 Zrna Research 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 or agreed to in writing... | 37.570876 | 145 | 0.610701 | # Copyright 2019 Zrna Research 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 or agreed to in writing... | 24,914 | 2,571 | 453 |
6f33e81c4dd3d799b26ae21e5fef90625ac3a799 | 3,916 | py | Python | src/github3/repos/invitation.py | toddrme2178/github3.py | b69951883d26e03fea9af59dc525e1fdcd38ad0f | [
"BSD-3-Clause"
] | null | null | null | src/github3/repos/invitation.py | toddrme2178/github3.py | b69951883d26e03fea9af59dc525e1fdcd38ad0f | [
"BSD-3-Clause"
] | 1 | 2021-06-02T00:37:10.000Z | 2021-06-02T00:37:10.000Z | virtual/Lib/site-packages/github3/repos/invitation.py | owenabrams/bluemoonkampala | 8801df64e91683a2641f2cd4bcbe03ebc7f40828 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Invitation related logic."""
from __future__ import unicode_literals
from json import dumps
from .. import models
from .. import users
from ..decorators import requires_auth
class Invitation(models.GitHubCore):
"""Representation of an invitation to collaborate on a repository.
.... | 30.356589 | 79 | 0.621297 | # -*- coding: utf-8 -*-
"""Invitation related logic."""
from __future__ import unicode_literals
from json import dumps
from .. import models
from .. import users
from ..decorators import requires_auth
class Invitation(models.GitHubCore):
"""Representation of an invitation to collaborate on a repository.
.... | 566 | 0 | 54 |
c9d69d4497bea09734e1164a508c9296e6ca71ab | 231 | py | Python | Exercicios mundo 1/ex067.py | prc3333/Exercicios--de-Phyton- | a4b54af45f6bb3a89a205b570e1cf1164e505e29 | [
"MIT"
] | null | null | null | Exercicios mundo 1/ex067.py | prc3333/Exercicios--de-Phyton- | a4b54af45f6bb3a89a205b570e1cf1164e505e29 | [
"MIT"
] | null | null | null | Exercicios mundo 1/ex067.py | prc3333/Exercicios--de-Phyton- | a4b54af45f6bb3a89a205b570e1cf1164e505e29 | [
"MIT"
] | null | null | null | while True:
t = int(input('Quer ver a tabuada de qual valor?'))
if t < 0:
break
print('-' * 32)
for c in range(1, 11):
print(f'{t} x {c:2} = {t*c}')
print('Programa Tabuada Encerrado.Volte Sempre!')
| 25.666667 | 55 | 0.545455 | while True:
t = int(input('Quer ver a tabuada de qual valor?'))
if t < 0:
break
print('-' * 32)
for c in range(1, 11):
print(f'{t} x {c:2} = {t*c}')
print('Programa Tabuada Encerrado.Volte Sempre!')
| 0 | 0 | 0 |
e893c1f002e93905e9e547dfafdb401824f00e29 | 4,772 | py | Python | make_movie.py | jprchlik/aia_mkmovie | 69b678e7e00ff6a93ee6fee74643f93ae539cde8 | [
"MIT"
] | 1 | 2019-06-12T16:30:57.000Z | 2019-06-12T16:30:57.000Z | make_movie.py | jprchlik/aia_mkmovie | 69b678e7e00ff6a93ee6fee74643f93ae539cde8 | [
"MIT"
] | 5 | 2017-08-15T14:07:43.000Z | 2018-01-22T21:01:40.000Z | make_movie.py | jprchlik/aia_mkmovie | 69b678e7e00ff6a93ee6fee74643f93ae539cde8 | [
"MIT"
] | 2 | 2018-10-23T16:40:10.000Z | 2019-06-12T16:30:36.000Z | import os
import subprocess
import shutil
import numpy as np
import glob
from multiprocessing import Pool
#gather files for creating symbolic links
#make sure nproc is greater than or equal to 1
# if self.nproc < 1:
# print 'Need to have at least 1 processor allocated'
# rai... | 42.990991 | 718 | 0.621333 | import os
import subprocess
import shutil
import numpy as np
import glob
from multiprocessing import Pool
class create_movie:
def __init__(self,odir='',pdir='track_plots/',ext='png',nproc=1,w0=1024,h0=1024,frate=10,outmov='movie.mp4'):
self.startd = os.getcwd()
#concert pdir into absolute path
... | 4,057 | -2 | 207 |
df8f654e63bbd407dab2d8eb1d85aa9fc76bf43d | 4,811 | py | Python | flask_resources/views/collections.py | lnielsen/flask-resources | a8be12765883edb1b1f63b4d289416e892d2cb02 | [
"MIT"
] | null | null | null | flask_resources/views/collections.py | lnielsen/flask-resources | a8be12765883edb1b1f63b4d289416e892d2cb02 | [
"MIT"
] | null | null | null | flask_resources/views/collections.py | lnielsen/flask-resources | a8be12765883edb1b1f63b4d289416e892d2cb02 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright (C) 2020 CERN.
#
# Flask-Resources is free software; you can redistribute it and/or modify
# it under the terms of the MIT License; see LICENSE file for more details.
"""Flask Resources module to create REST APIs."""
from werkzeug.exceptions import HTTPException
from ..args.pars... | 39.434426 | 88 | 0.67699 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2020 CERN.
#
# Flask-Resources is free software; you can redistribute it and/or modify
# it under the terms of the MIT License; see LICENSE file for more details.
"""Flask Resources module to create REST APIs."""
from werkzeug.exceptions import HTTPException
from ..args.pars... | 0 | 0 | 0 |
b145b1d5dc382a6678992d084c7bd45457517fb2 | 176 | py | Python | server/src/test/selenium/test_login.py | zstars/weblabdeusto | 09bd9d93d483671bca67ee5c70a9c412eb5d352f | [
"BSD-2-Clause"
] | null | null | null | server/src/test/selenium/test_login.py | zstars/weblabdeusto | 09bd9d93d483671bca67ee5c70a9c412eb5d352f | [
"BSD-2-Clause"
] | null | null | null | server/src/test/selenium/test_login.py | zstars/weblabdeusto | 09bd9d93d483671bca67ee5c70a9c412eb5d352f | [
"BSD-2-Clause"
] | null | null | null | import time
from base import SeleniumBaseTest
| 19.555556 | 44 | 0.693182 | import time
from base import SeleniumBaseTest
class TestLogin(SeleniumBaseTest):
def test_load(self):
self.driver.get(self.base_url + "/")
time.sleep(10) | 67 | 13 | 50 |
c0c7442fdb48cc4eab07cacb57211ca6161dc179 | 1,268 | py | Python | OpenRobertaParent/RobotNAO/src/test/resources/lists/nao_lists_sublist_test.py | WGraterol64/robertalab | 368c970c06008c6b56e59e3df19daf6e00022ad9 | [
"Apache-2.0"
] | 1 | 2019-06-04T05:01:35.000Z | 2019-06-04T05:01:35.000Z | OpenRobertaParent/RobotNAO/src/test/resources/lists/nao_lists_sublist_test.py | WGraterol64/robertalab | 368c970c06008c6b56e59e3df19daf6e00022ad9 | [
"Apache-2.0"
] | null | null | null | OpenRobertaParent/RobotNAO/src/test/resources/lists/nao_lists_sublist_test.py | WGraterol64/robertalab | 368c970c06008c6b56e59e3df19daf6e00022ad9 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
import math
import time
from roberta import Hal
from roberta import BlocklyMethods
h = Hal()
item = BlocklyMethods.createListWith(0, 0, 0)
item2 = BlocklyMethods.createListWith()
item3 = BlocklyMethods.createListWith()
item4 = BlocklyMethods.createListWith()
item5 = BlocklyMethods.createListWith()
... | 33.368421 | 82 | 0.694795 | #!/usr/bin/python
import math
import time
from roberta import Hal
from roberta import BlocklyMethods
h = Hal()
item = BlocklyMethods.createListWith(0, 0, 0)
item2 = BlocklyMethods.createListWith()
item3 = BlocklyMethods.createListWith()
item4 = BlocklyMethods.createListWith()
item5 = BlocklyMethods.createListWith()
... | 864 | 0 | 46 |
2a902b58ecc54d040c4e97a0af4e9c892b0156e2 | 2,529 | py | Python | src/python/comments/comment_extractor_python.py | pamelarussell/github-bioinformatics | 0e7184cae57426c25cfa0e838637d34adf0a59e7 | [
"MIT"
] | 32 | 2018-05-14T20:34:08.000Z | 2022-03-22T12:37:19.000Z | src/python/comments/comment_extractor_python.py | pamelarussell/github-bioinformatics | 0e7184cae57426c25cfa0e838637d34adf0a59e7 | [
"MIT"
] | null | null | null | src/python/comments/comment_extractor_python.py | pamelarussell/github-bioinformatics | 0e7184cae57426c25cfa0e838637d34adf0a59e7 | [
"MIT"
] | 6 | 2018-07-11T17:15:07.000Z | 2021-08-02T19:51:40.000Z | import re
from re import MULTILINE, DOTALL
from comments import CommentExtractor
class CommentExtractorPython(CommentExtractor):
""" Comment extractor for Python code """
def __process_single_line_match(self, match):
""" Process a regular expression match object for a single line comment and return
... | 40.790323 | 106 | 0.6121 | import re
from re import MULTILINE, DOTALL
from comments import CommentExtractor
class CommentExtractorPython(CommentExtractor):
""" Comment extractor for Python code """
def __process_single_line_match(self, match):
""" Process a regular expression match object for a single line comment and return
... | 0 | 0 | 0 |
da6f6a601387c50a268bfd5ec8113829eaca65af | 5,892 | py | Python | Legend.py | ChrisCFTung/FIRESONG | e00c6ec7e00a6ccb4b993d891512ae1111f5111b | [
"BSD-3-Clause"
] | 10 | 2018-02-01T10:52:05.000Z | 2021-06-25T13:05:37.000Z | Legend.py | ChrisCFTung/FIRESONG | e00c6ec7e00a6ccb4b993d891512ae1111f5111b | [
"BSD-3-Clause"
] | 3 | 2018-03-10T09:34:56.000Z | 2020-09-30T15:34:02.000Z | Legend.py | ChrisCFTung/FIRESONG | e00c6ec7e00a6ccb4b993d891512ae1111f5111b | [
"BSD-3-Clause"
] | 5 | 2017-11-16T09:55:45.000Z | 2021-02-03T16:56:17.000Z | #!/usr/bin/python
# Authors: Chris Tung
# Ignacio Taboada
#
"""Example script that simulates a population of sources with a luminosity
distribution that is dependent on redshift"""
# General imports
# from __future__ import division
import argparse
# Numpy / Scipy
import numpy as np
# Firesong code
from ... | 38.509804 | 82 | 0.595214 | #!/usr/bin/python
# Authors: Chris Tung
# Ignacio Taboada
#
"""Example script that simulates a population of sources with a luminosity
distribution that is dependent on redshift"""
# General imports
# from __future__ import division
import argparse
# Numpy / Scipy
import numpy as np
# Firesong code
from ... | 0 | 0 | 0 |
0fc501d8919958ec96c1dcf057862e9117fad4f0 | 1,640 | py | Python | setup.py | decafjoe/clik-wtforms | 38708ee6ce1c8b426648e83371a7a0ce24982b3d | [
"BSD-3-Clause"
] | null | null | null | setup.py | decafjoe/clik-wtforms | 38708ee6ce1c8b426648e83371a7a0ce24982b3d | [
"BSD-3-Clause"
] | null | null | null | setup.py | decafjoe/clik-wtforms | 38708ee6ce1c8b426648e83371a7a0ce24982b3d | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Package configuration for clik-wtforms.
:author: Joe Joyce <joe@decafjoe.com>
:copyright: Copyright (c) Joe Joyce and contributors, 2017-2019.
:license: BSD
"""
import os
from setuptools import find_packages, setup
name = 'clik-wtforms'
version = '0.90.2'
requires = (
'clik',
'w... | 27.333333 | 69 | 0.639024 | # -*- coding: utf-8 -*-
"""
Package configuration for clik-wtforms.
:author: Joe Joyce <joe@decafjoe.com>
:copyright: Copyright (c) Joe Joyce and contributors, 2017-2019.
:license: BSD
"""
import os
from setuptools import find_packages, setup
name = 'clik-wtforms'
version = '0.90.2'
requires = (
'clik',
'w... | 0 | 0 | 0 |
8b4d6f1dacadd766bfdf3d03e71a4d739eeeebc5 | 5,567 | py | Python | mathseq/seq.py | TheGreatestShoaib/MathSeq | 04134e8db030716c35beebbffabd719a353dfb2c | [
"MIT"
] | 1 | 2021-11-11T09:57:46.000Z | 2021-11-11T09:57:46.000Z | mathseq/seq.py | TheGreatestShoaib/MathSeq | 04134e8db030716c35beebbffabd719a353dfb2c | [
"MIT"
] | null | null | null | mathseq/seq.py | TheGreatestShoaib/MathSeq | 04134e8db030716c35beebbffabd719a353dfb2c | [
"MIT"
] | null | null | null | """
this is the doc string of this model
i'll just write it someday just yeah thats all
"""
import time
import random
def composite_numbers():
'''
-It generates composite numbers which are just opposite of prime numbers,,
it means real numbers that
aren't a prime number is a composite number
'''
n = 2
while ... | 19.953405 | 109 | 0.672175 | """
this is the doc string of this model
i'll just write it someday just yeah thats all
"""
import time
import random
def composite_numbers():
'''
-It generates composite numbers which are just opposite of prime numbers,,
it means real numbers that
aren't a prime number is a composite number
'''
n = 2
while ... | 215 | 0 | 24 |
ef5f28f7aecce1e45889f15945f0e1d0ff371954 | 542 | py | Python | Medium/Prime Time.py | edaaydinea/Coderbyte | 83d0fcde12c937b95e8b6f819df08b8b9e03ac55 | [
"MIT"
] | 6 | 2022-01-05T12:14:11.000Z | 2022-03-10T16:28:23.000Z | Medium/Prime Time.py | edaaydinea/Coderbyte | 83d0fcde12c937b95e8b6f819df08b8b9e03ac55 | [
"MIT"
] | null | null | null | Medium/Prime Time.py | edaaydinea/Coderbyte | 83d0fcde12c937b95e8b6f819df08b8b9e03ac55 | [
"MIT"
] | null | null | null | """
Prime Time
Have the function PrimeTime(num) take the num parameter being passed and
return the string true if the parameter is a prime number, otherwise return the string false.
The range will be between 1 and 2^16.
Examples
Input: 19
Output: true
Input: 110
Output: false
Author: Eda AYDIN
"""
# keep this fu... | 16.9375 | 93 | 0.643911 | """
Prime Time
Have the function PrimeTime(num) take the num parameter being passed and
return the string true if the parameter is a prime number, otherwise return the string false.
The range will be between 1 and 2^16.
Examples
Input: 19
Output: true
Input: 110
Output: false
Author: Eda AYDIN
"""
def PrimeTime(n... | 151 | 0 | 23 |
fc6a3c02328b829cd98097754690f67cffab23de | 19,680 | py | Python | spar_python/report_generation/ta1/ta1_schema.py | nathanawmk/SPARTA | 6eeb28b2dd147088b6e851876b36eeba3e700f16 | [
"BSD-2-Clause"
] | 37 | 2017-06-09T13:55:23.000Z | 2022-01-28T12:51:17.000Z | spar_python/report_generation/ta1/ta1_schema.py | nathanawmk/SPARTA | 6eeb28b2dd147088b6e851876b36eeba3e700f16 | [
"BSD-2-Clause"
] | null | null | null | spar_python/report_generation/ta1/ta1_schema.py | nathanawmk/SPARTA | 6eeb28b2dd147088b6e851876b36eeba3e700f16 | [
"BSD-2-Clause"
] | 5 | 2017-06-09T13:55:26.000Z | 2021-11-11T03:51:56.000Z | # *****************************************************************
# Copyright 2013 MIT Lincoln Laboratory
# Project: SPAR
# Authors: SY
# Description: Constants for TA1 analytics.
#
#
# Modifications:
# Date Name Modification
# ---- ... | 35.142857 | 79 | 0.72749 | # *****************************************************************
# Copyright 2013 MIT Lincoln Laboratory
# Project: SPAR
# Authors: SY
# Description: Constants for TA1 analytics.
#
#
# Modifications:
# Date Name Modification
# ---- ... | 450 | 435 | 23 |
23a7a6047fa6e56361e584e62db19df5c2858ab3 | 1,207 | py | Python | ext/ws/rs/client/__init__.py | mariano-git/plugin.video.flow | a63362f308c1e67ba532acf9ba4eced95a243f49 | [
"MIT"
] | 3 | 2022-01-19T00:27:24.000Z | 2022-03-24T15:15:24.000Z | ext/ws/rs/client/__init__.py | mariano-git/plugin.video.flow | a63362f308c1e67ba532acf9ba4eced95a243f49 | [
"MIT"
] | 3 | 2021-12-30T06:05:30.000Z | 2022-01-19T02:52:21.000Z | ext/ws/rs/client/__init__.py | mariano-git/plugin.video.flow | a63362f308c1e67ba532acf9ba4eced95a243f49 | [
"MIT"
] | null | null | null | from abc import abstractmethod
from typing import List, Any
| 21.945455 | 99 | 0.6628 | from abc import abstractmethod
from typing import List, Any
class ClientRequestContext:
def __init__(self,method, url, headers, query, body):
self.method = method
self.url = url
self.headers = headers
self.query = query
self.body = body
class ClientResponseContext:
de... | 675 | 146 | 319 |
30131ecadd4cf71fffac3f92f54d5a9a49a201ca | 11,343 | py | Python | test/test.py | typo-ai/target-typo | 02a22033aad048b0b21445ba329dc1eed57d3e03 | [
"Apache-2.0"
] | null | null | null | test/test.py | typo-ai/target-typo | 02a22033aad048b0b21445ba329dc1eed57d3e03 | [
"Apache-2.0"
] | null | null | null | test/test.py | typo-ai/target-typo | 02a22033aad048b0b21445ba329dc1eed57d3e03 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019-2020 Typo. 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 applicable law or agreed... | 30.410188 | 111 | 0.532311 | # Copyright 2019-2020 Typo. 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 applicable law or agreed... | 207 | 10,054 | 46 |
48a3d2ec08b2712e57e02fb371f1828897ad3c5f | 2,759 | py | Python | radscirc.py | jmonrods/pyeis | e354691cd4d3a9a80c4e42e99129d6ee704f0f46 | [
"MIT"
] | null | null | null | radscirc.py | jmonrods/pyeis | e354691cd4d3a9a80c4e42e99129d6ee704f0f46 | [
"MIT"
] | 3 | 2021-11-02T22:42:33.000Z | 2021-11-02T22:54:49.000Z | radscirc.py | jmonrods/pyeis | e354691cd4d3a9a80c4e42e99129d6ee704f0f46 | [
"MIT"
] | null | null | null | #Menu for the circuit configurations (returns circuit string)
# ------------------------------------------------------
# Copyright (C) 2020 Gustavo Rodriguez Gutierrez
# Licensed under the MIT license, see LICENSE.
# ------------------------------------------------------
from tkinter import *
from PIL import Im... | 34.4875 | 95 | 0.558173 | #Menu for the circuit configurations (returns circuit string)
# ------------------------------------------------------
# Copyright (C) 2020 Gustavo Rodriguez Gutierrez
# Licensed under the MIT license, see LICENSE.
# ------------------------------------------------------
from tkinter import *
from PIL import Im... | 2,013 | 0 | 24 |
6a3ef4fdaf9fc2ac365bbd9448b11bae9a903dc7 | 18,176 | py | Python | cogs/migratedb.py | Kammet07/miso-bot | 87036742fc49d6c78e6308a323cff0248fcec77d | [
"MIT"
] | null | null | null | cogs/migratedb.py | Kammet07/miso-bot | 87036742fc49d6c78e6308a323cff0248fcec77d | [
"MIT"
] | null | null | null | cogs/migratedb.py | Kammet07/miso-bot | 87036742fc49d6c78e6308a323cff0248fcec77d | [
"MIT"
] | null | null | null | from discord.ext import commands
import arrow
import sqlite3
from libraries import emoji_literals
SQLDATABASE = "data/database.db"
| 32.631957 | 128 | 0.545224 | from discord.ext import commands
import arrow
import sqlite3
from libraries import emoji_literals
SQLDATABASE = "data/database.db"
def query(command, parameters=(), maketuple=False, database=SQLDATABASE):
connection = sqlite3.connect(database, timeout=10)
cursor = connection.cursor()
cursor.execute(comm... | 16,935 | 1,036 | 69 |
146721335dcc877f7d57359f010dd8cf80c09e0c | 27,968 | py | Python | sdk/python/pulumi_mongodbatlas/cloud_provider_snapshot.py | pulumi/pulumi-mongodbatlas | 0d5c085dcfd871b56fb4cf582620260b70caa07a | [
"ECL-2.0",
"Apache-2.0"
] | 9 | 2020-04-28T19:12:30.000Z | 2022-03-22T23:04:46.000Z | sdk/python/pulumi_mongodbatlas/cloud_provider_snapshot.py | pulumi/pulumi-mongodbatlas | 0d5c085dcfd871b56fb4cf582620260b70caa07a | [
"ECL-2.0",
"Apache-2.0"
] | 59 | 2020-06-12T12:12:52.000Z | 2022-03-28T18:14:50.000Z | sdk/python/pulumi_mongodbatlas/cloud_provider_snapshot.py | pulumi/pulumi-mongodbatlas | 0d5c085dcfd871b56fb4cf582620260b70caa07a | [
"ECL-2.0",
"Apache-2.0"
] | 2 | 2020-09-25T21:22:08.000Z | 2021-08-30T20:06:18.000Z | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from . import ... | 44.606061 | 275 | 0.661756 | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from . import ... | 4,248 | 23,213 | 67 |
c8ecc91ac600ea10173f3b256ce6fcdd2eb05b33 | 528 | py | Python | C07_enum.py | lleej/python | f4eff76819cec2c479ec19a4940141406079cb9a | [
"MIT"
] | null | null | null | C07_enum.py | lleej/python | f4eff76819cec2c479ec19a4940141406079cb9a | [
"MIT"
] | 2 | 2018-02-01T02:54:17.000Z | 2018-06-14T03:18:51.000Z | C07_enum.py | lleej/python | f4eff76819cec2c479ec19a4940141406079cb9a | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
'枚举类的练习'
__author__ = 'Jacklee'
# 导入模块
#import types
# 月份常量
JAN = 1
FEB = 2
MAR = 3
# 枚举类
from enum import Enum, unique
## 第一种定义方式
@unique
## 第二种定义方式
WeekDay = Enum('WeekDay', ('Mon', 'Tue', 'Wed', 'Tru', 'Fri', 'Sat', 'Sun'))
## 类的组成,JAN ... 是一个类成员
print('Month类的成... | 12.571429 | 76 | 0.600379 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
'枚举类的练习'
__author__ = 'Jacklee'
# 导入模块
#import types
# 月份常量
JAN = 1
FEB = 2
MAR = 3
# 枚举类
from enum import Enum, unique
## 第一种定义方式
@unique
class Month(Enum):
JAN = 0
FEB = 1
MAR = 2
## 第二种定义方式
WeekDay = Enum('WeekDay', ('Mon', 'Tue', 'Wed', 'Tru', 'Fri', 'Sat', '... | 0 | 24 | 22 |
33dc23591462f9d8e97e54522d82496300c198a0 | 2,807 | py | Python | bot-pipelines.py | jonativia/gitlab_utils | dea6d0a6b553b71b8b472f65f34dafa7afa463f3 | [
"Apache-2.0"
] | 1 | 2020-02-05T14:52:45.000Z | 2020-02-05T14:52:45.000Z | bot-pipelines.py | jonazpiazu/gitlab_utils | 3a2394fe7c7ce88f686096dee2fed0c80823be58 | [
"Apache-2.0"
] | 1 | 2021-03-01T21:19:47.000Z | 2021-03-01T21:19:47.000Z | bot-pipelines.py | jonativia/gitlab_utils | dea6d0a6b553b71b8b472f65f34dafa7afa463f3 | [
"Apache-2.0"
] | 1 | 2021-03-01T16:29:55.000Z | 2021-03-01T16:29:55.000Z | #!/usr/bin/env python
# Copyright 2019 Jon Azpiazu
#
# 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 a... | 35.987179 | 87 | 0.689704 | #!/usr/bin/env python
# Copyright 2019 Jon Azpiazu
#
# 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 a... | 1,460 | 0 | 22 |
6138d347fce46ef1d91da96ac0a880b15add23b2 | 842 | py | Python | scripts/satlib.py | simonkrogmann/satexplorer | 4904d7828a5746a1e19bffb82573447fbf648207 | [
"MIT"
] | null | null | null | scripts/satlib.py | simonkrogmann/satexplorer | 4904d7828a5746a1e19bffb82573447fbf648207 | [
"MIT"
] | null | null | null | scripts/satlib.py | simonkrogmann/satexplorer | 4904d7828a5746a1e19bffb82573447fbf648207 | [
"MIT"
] | null | null | null | '''
Helper classes for handling SAT Formulas
''' | 38.272727 | 102 | 0.648456 | '''
Helper classes for handling SAT Formulas
'''
class Clause:
def __init__(self, literals):
self.positive_literals = []
self.negative_literals = []
for literal in literals:
if literal < 0:
self.negative_literals.append(literal)
else:
... | 699 | -8 | 103 |
74db45933ac3bbb67695886bfc5f7976c0580c6c | 640 | py | Python | insrunner/arch/x86.py | MatejKastak/insrunner | 6c99b7c4c6768003ea5822d03b916f2f17ee5900 | [
"MIT"
] | null | null | null | insrunner/arch/x86.py | MatejKastak/insrunner | 6c99b7c4c6768003ea5822d03b916f2f17ee5900 | [
"MIT"
] | null | null | null | insrunner/arch/x86.py | MatejKastak/insrunner | 6c99b7c4c6768003ea5822d03b916f2f17ee5900 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# X86 architectures
# Author: Matej Kastak
from . import Architecture
| 25.6 | 68 | 0.671875 | #!/usr/bin/env python
# X86 architectures
# Author: Matej Kastak
from . import Architecture
class ArchitectureX86(Architecture):
def __init__(self):
self.arch_name = 'x86'
self.pc_reg = 'eip'
self.ignored_regs = {'eip'} # TODO: check implementation
self.retdec_translator = 'Caps... | 412 | 33 | 100 |
f11e5f8409dabccd94700586da503ba0f40f3a11 | 286 | py | Python | hacker-rank/implementation/cut_the_sticks.py | denisrmp/hacker-rank | db490b1b2d41ed6913b4cacee1b4bb40e15186b7 | [
"MIT"
] | null | null | null | hacker-rank/implementation/cut_the_sticks.py | denisrmp/hacker-rank | db490b1b2d41ed6913b4cacee1b4bb40e15186b7 | [
"MIT"
] | null | null | null | hacker-rank/implementation/cut_the_sticks.py | denisrmp/hacker-rank | db490b1b2d41ed6913b4cacee1b4bb40e15186b7 | [
"MIT"
] | null | null | null | # https://www.hackerrank.com/challenges/cut-the-sticks
n = int(input().strip())
arr = list(map(int, input().strip().split(' ')))
while len(arr) > 0:
arr2 = []
for e in arr:
e -= min(arr)
if e > 0:
arr2.append(e)
print(len(arr))
arr = arr2
| 19.066667 | 54 | 0.524476 | # https://www.hackerrank.com/challenges/cut-the-sticks
n = int(input().strip())
arr = list(map(int, input().strip().split(' ')))
while len(arr) > 0:
arr2 = []
for e in arr:
e -= min(arr)
if e > 0:
arr2.append(e)
print(len(arr))
arr = arr2
| 0 | 0 | 0 |
6b2e67dbc8d7ee42f84d628b1ec9e9f95806ef53 | 10,282 | py | Python | tests/integration/test_payments.py | icebotariccl/currencycloud-python | 03bb0df2743e6669790dee6f2367f9e0500a4610 | [
"MIT"
] | null | null | null | tests/integration/test_payments.py | icebotariccl/currencycloud-python | 03bb0df2743e6669790dee6f2367f9e0500a4610 | [
"MIT"
] | null | null | null | tests/integration/test_payments.py | icebotariccl/currencycloud-python | 03bb0df2743e6669790dee6f2367f9e0500a4610 | [
"MIT"
] | null | null | null | import pytest
from betamax import Betamax
from currencycloud import Client, Config
from currencycloud.errors import NotFoundError
from currencycloud.resources import *
| 47.823256 | 107 | 0.612624 | import pytest
from betamax import Betamax
from currencycloud import Client, Config
from currencycloud.errors import NotFoundError
from currencycloud.resources import *
class TestPayments:
paymentId = None
def setup_method(self, method):
# TODO: To run against real server please delete ../fixtures/vc... | 9,838 | 251 | 23 |
3fbe487600ef59b063f0193d9ba43167a6f30310 | 1,191 | py | Python | urls.py | abezpalov/project | 9dbfacf0cc6a55dd4ded436c57f82768aa8d2f30 | [
"MIT"
] | null | null | null | urls.py | abezpalov/project | 9dbfacf0cc6a55dd4ded436c57f82768aa8d2f30 | [
"MIT"
] | 8 | 2015-08-11T15:40:04.000Z | 2016-10-01T06:18:34.000Z | urls.py | abezpalov/project | 9dbfacf0cc6a55dd4ded436c57f82768aa8d2f30 | [
"MIT"
] | null | null | null | from django.conf.urls import include, url
from django.contrib import admin
import project.views
admin.autodiscover()
urlpatterns = [
url(r'^$', project.views.home),
url(r'^catalog/', include('catalog.urls')),
url(r'^tenders/', include('tenders.urls')),
url(r'^admin/', include(admin.site.urls)),
url(r'^article... | 32.189189 | 86 | 0.723762 | from django.conf.urls import include, url
from django.contrib import admin
import project.views
admin.autodiscover()
urlpatterns = [
url(r'^$', project.views.home),
url(r'^catalog/', include('catalog.urls')),
url(r'^tenders/', include('tenders.urls')),
url(r'^admin/', include(admin.site.urls)),
url(r'^article... | 0 | 0 | 0 |
cf617ba31bedea9fc1cc81640af965872e60285b | 2,526 | py | Python | pub_data_visualization/outages/plot/subplot/incremental_programs.py | l-leo/pub-data-visualization | 68eea00491424581b057495a7f0f69cf74e16e7d | [
"MIT"
] | 1 | 2021-01-22T16:47:20.000Z | 2021-01-22T16:47:20.000Z | pub_data_visualization/outages/plot/subplot/incremental_programs.py | l-leo/pub-data-visualization | 68eea00491424581b057495a7f0f69cf74e16e7d | [
"MIT"
] | null | null | null | pub_data_visualization/outages/plot/subplot/incremental_programs.py | l-leo/pub-data-visualization | 68eea00491424581b057495a7f0f69cf74e16e7d | [
"MIT"
] | null | null | null |
import itertools
#
from .... import global_tools, global_var
def incremental_programs(ax,
df_programs,
diff_init = False,
smoother = None,
):
"""
Draws in a subplot the expected availability programs
... | 36.608696 | 114 | 0.454078 |
import itertools
#
from .... import global_tools, global_var
def incremental_programs(ax,
df_programs,
diff_init = False,
smoother = None,
):
"""
Draws in a subplot the expected availability programs
... | 0 | 0 | 0 |
49f1c65723bc2a06051cb9d111adc0415c671f9e | 591 | py | Python | {{cookiecutter.project_name}}/{{cookiecutter.project_name}}/tests/test_{{cookiecutter.project_name}}.py | mlf4aiur/cookiecutter-daemon | 510b39c38d11f9b556185b24c9a1eca79665db5c | [
"BSD-3-Clause"
] | 1 | 2015-11-23T05:21:37.000Z | 2015-11-23T05:21:37.000Z | {{cookiecutter.project_name}}/{{cookiecutter.project_name}}/tests/test_{{cookiecutter.project_name}}.py | mlf4aiur/cookiecutter-daemon | 510b39c38d11f9b556185b24c9a1eca79665db5c | [
"BSD-3-Clause"
] | null | null | null | {{cookiecutter.project_name}}/{{cookiecutter.project_name}}/tests/test_{{cookiecutter.project_name}}.py | mlf4aiur/cookiecutter-daemon | 510b39c38d11f9b556185b24c9a1eca79665db5c | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest
from {{cookiecutter.project_name}} import skeleton
if __name__ == "__main__":
from unittest import TestLoader, TextTestRunner
suite = TestLoader().loadTestsFromTestCase(SkeletonTestCase)
TextTestRunner(verbosity=2).run(... | 23.64 | 70 | 0.71066 | #!/usr/bin/env python
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest
from {{cookiecutter.project_name}} import skeleton
class SkeletonTestCase(unittest.TestCase):
def setUp(self):
self.skeleton = skeleton.Skeleton("conf/main.cfg")
def tearDown(self):
pass
def test_attribu... | 140 | 21 | 103 |
0c6332aed828b3c45f70354cbd6dbc6cec4f9032 | 4,462 | py | Python | raycasting.py | FelipeEd/PygameRaycaster | 56291c89612d51163bcb2f81367fcfe0256ec717 | [
"MIT"
] | 1 | 2021-04-15T22:25:54.000Z | 2021-04-15T22:25:54.000Z | raycasting.py | FelipeEd/PygameRaycaster | 56291c89612d51163bcb2f81367fcfe0256ec717 | [
"MIT"
] | null | null | null | raycasting.py | FelipeEd/PygameRaycaster | 56291c89612d51163bcb2f81367fcfe0256ec717 | [
"MIT"
] | null | null | null | import pygame
from settings import *
from player import Player
from map import world_map
'''
pygame.draw.line(screen, RED, player.pos, (player.x + RENDER_DIST * math.cos(player.angle)
, player.y + RENDER_DIST * math.sin(player.angle)))
pygame.draw.line(screen, PURP... | 35.133858 | 110 | 0.504706 | import pygame
from settings import *
from player import Player
from map import world_map
def rgrid(x):
return x // TILE * TILE
def Raycasting(screen,player):
# mock
world_size = 20
for ray_n in range(N_RAYS):
ray_angle = player.angle + ray_n * D_ANGLE - FOV/2
x0 = play... | 2,256 | 0 | 46 |
e06f7d5e71cf23adfb913d7716c5d363ef4c7a49 | 2,457 | py | Python | models/experimental/show_and_tell/show_and_tell_tpu_test.py | gogasca/tpu | e8801a42e2e2217c464d6a7870e40f19f0ae936b | [
"Apache-2.0"
] | 53 | 2019-10-02T22:00:54.000Z | 2021-11-16T13:50:02.000Z | models/experimental/show_and_tell/show_and_tell_tpu_test.py | gogasca/tpu | e8801a42e2e2217c464d6a7870e40f19f0ae936b | [
"Apache-2.0"
] | 3 | 2021-03-31T20:15:40.000Z | 2022-02-09T23:50:46.000Z | models/experimental/show_and_tell/show_and_tell_tpu_test.py | gogasca/tpu | e8801a42e2e2217c464d6a7870e40f19f0ae936b | [
"Apache-2.0"
] | 7 | 2019-10-02T14:24:37.000Z | 2020-05-06T08:19:59.000Z | # Copyright 2018 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... | 33.657534 | 80 | 0.690273 | # Copyright 2018 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... | 1,243 | 22 | 70 |
bcbba369065c49092bbc64cc30d289a774884ad8 | 9,866 | py | Python | gym_carla/envs/route_planner.py | amirx96/gym-carla | 55900c961b3fafa60e3bece7d4da0445a402e801 | [
"MIT"
] | null | null | null | gym_carla/envs/route_planner.py | amirx96/gym-carla | 55900c961b3fafa60e3bece7d4da0445a402e801 | [
"MIT"
] | null | null | null | gym_carla/envs/route_planner.py | amirx96/gym-carla | 55900c961b3fafa60e3bece7d4da0445a402e801 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# Copyright (c) 2019: Jianyu Chen (jianyuchen@berkeley.edu).
#
# This file is modified from <https://github.com/carla-simulator/carla>:
# Copyright (c) 2018 Intel Labs.
# authors: German Ros (german.ros@intel.com)
#
# This work is licensed under the terms of the MIT license.
# For a copy, see <ht... | 34.862191 | 119 | 0.708798 | #!/usr/bin/env python
# Copyright (c) 2019: Jianyu Chen (jianyuchen@berkeley.edu).
#
# This file is modified from <https://github.com/carla-simulator/carla>:
# Copyright (c) 2018 Intel Labs.
# authors: German Ros (german.ros@intel.com)
#
# This work is licensed under the terms of the MIT license.
# For a copy, see <ht... | 1,379 | 6,067 | 23 |
d27150502f9977d9345e16461b49b102885cbf33 | 9,904 | py | Python | encoders/nlp/TransformerTorchEncoder/__init__.py | Harshdeep1996/jina-hub | 880ff719715b89969860c70219d26a931a031d10 | [
"Apache-2.0"
] | null | null | null | encoders/nlp/TransformerTorchEncoder/__init__.py | Harshdeep1996/jina-hub | 880ff719715b89969860c70219d26a931a031d10 | [
"Apache-2.0"
] | 5,414 | 2021-04-06T09:04:26.000Z | 2022-03-30T13:12:40.000Z | encoders/nlp/TransformerTorchEncoder/__init__.py | rutujasurve94/jina-hub | 582bca03c85c421dfda980a624131f1db200857c | [
"Apache-2.0"
] | null | null | null | __copyright__ = "Copyright (c) 2021 Jina AI Limited. All rights reserved."
__license__ = "Apache-2.0"
import time
from typing import Optional, Dict
import numpy as np
from jina.executors.decorators import batching, as_ndarray
from jina.executors.devices import TorchDevice
from jina.executors.encoders import BaseEnc... | 41.095436 | 124 | 0.61874 | __copyright__ = "Copyright (c) 2021 Jina AI Limited. All rights reserved."
__license__ = "Apache-2.0"
import time
from typing import Optional, Dict
import numpy as np
from jina.executors.decorators import batching, as_ndarray
from jina.executors.devices import TorchDevice
from jina.executors.encoders import BaseEnc... | 4,631 | 0 | 81 |
68bfe88b6aba2e556194770846796acc594986e4 | 24 | py | Python | variables/prodeu/handisaggeu_spot.py | rohithasrk-bidgely/cloudformation-config-generation | d72d362c77b220169b3ccdd0b4a921910f7172ff | [
"MIT"
] | null | null | null | variables/prodeu/handisaggeu_spot.py | rohithasrk-bidgely/cloudformation-config-generation | d72d362c77b220169b3ccdd0b4a921910f7172ff | [
"MIT"
] | 9 | 2018-07-09T08:46:12.000Z | 2018-07-18T09:13:03.000Z | variables/uat/handisaggna_spot.py | rohithasrk-bidgely/cloudformation-config-generation | d72d362c77b220169b3ccdd0b4a921910f7172ff | [
"MIT"
] | null | null | null | tagcomponent = "disagg"
| 12 | 23 | 0.75 | tagcomponent = "disagg"
| 0 | 0 | 0 |
92f81deeca05af9aba907e26041e2fa998bf98de | 10,647 | py | Python | packages/syft/src/syft/core/node/common/action/function_or_constructor_action.py | BearerPipelineTest/PySyft | 5d4abfbc53c8d3a48f85606d43f7fd9b05a16b3d | [
"Apache-2.0"
] | null | null | null | packages/syft/src/syft/core/node/common/action/function_or_constructor_action.py | BearerPipelineTest/PySyft | 5d4abfbc53c8d3a48f85606d43f7fd9b05a16b3d | [
"Apache-2.0"
] | null | null | null | packages/syft/src/syft/core/node/common/action/function_or_constructor_action.py | BearerPipelineTest/PySyft | 5d4abfbc53c8d3a48f85606d43f7fd9b05a16b3d | [
"Apache-2.0"
] | null | null | null | # stdlib
from typing import Any
from typing import Dict
from typing import List
from typing import Optional
from typing import Tuple
from typing import Union
# third party
from google.protobuf.reflection import GeneratedProtocolMessageType
from nacl.signing import VerifyKey
# syft absolute
import syft as sy
# relati... | 38.857664 | 108 | 0.639053 | # stdlib
from typing import Any
from typing import Dict
from typing import List
from typing import Optional
from typing import Tuple
from typing import Union
# third party
from google.protobuf.reflection import GeneratedProtocolMessageType
from nacl.signing import VerifyKey
# syft absolute
import syft as sy
# relati... | 5,315 | 0 | 107 |
cad03eca82c8be6e3378e1003ea67a4f38e2324e | 14,254 | py | Python | inputFiles/largeur_longueur.py | dimtion/jml | dba4db760280cc5ed8c384e36e41d6c7a310fb4f | [
"MIT"
] | 1 | 2015-10-07T19:18:55.000Z | 2015-10-07T19:18:55.000Z | inputFiles/largeur_longueur.py | dimtion/jml | dba4db760280cc5ed8c384e36e41d6c7a310fb4f | [
"MIT"
] | 1 | 2015-10-07T19:28:25.000Z | 2015-10-08T19:01:47.000Z | inputFiles/largeur_longueur.py | dimtion/jml | dba4db760280cc5ed8c384e36e41d6c7a310fb4f | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
####################################################################################################################################################################################################################################
############################################... | 60.91453 | 228 | 0.341378 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
####################################################################################################################################################################################################################################
############################################... | 1,405 | 2 | 241 |
462f9d0c6d85bf21de29f9ad930fdb5a0454bc16 | 920 | py | Python | config.py | mt32net/cmm_notifier | 4d52a32c5074b1a1f584e1d1ddfa1c3566abd476 | [
"MIT"
] | null | null | null | config.py | mt32net/cmm_notifier | 4d52a32c5074b1a1f584e1d1ddfa1c3566abd476 | [
"MIT"
] | null | null | null | config.py | mt32net/cmm_notifier | 4d52a32c5074b1a1f584e1d1ddfa1c3566abd476 | [
"MIT"
] | null | null | null | import os
import json
config = {
"secret": "",
"uuid": "",
"endpointURL": ""
}
def is_file_empty(file_path):
""" Check if file is empty by confirming if its size is 0 bytes"""
# Check if file exist and it is empty
return os.path.exists(file_path) and os.stat(file_path).st_size == 0 and os.... | 20.909091 | 108 | 0.601087 | import os
import json
config = {
"secret": "",
"uuid": "",
"endpointURL": ""
}
def getDeviceSecret():
return config["secret"]
def getDeviceUUID():
return config["uuid"]
def getServerAddress():
addr = config["endpointURL"]
if addr.endswith("/"):
addr = addr[:-1]
return addr... | 455 | 0 | 115 |
16c3d0362f2f84659389a285ae9a730702f136ad | 12,321 | py | Python | tests/allen/models/target_sentiment/interactive_attention_network_test.py | apmoore1/target-extraction | 4139ecdc432411fcc4ed2723f4165e7dae93544d | [
"Apache-2.0"
] | 5 | 2019-07-27T13:57:47.000Z | 2021-06-16T13:17:44.000Z | tests/allen/models/target_sentiment/interactive_attention_network_test.py | apmoore1/target-extraction | 4139ecdc432411fcc4ed2723f4165e7dae93544d | [
"Apache-2.0"
] | 26 | 2019-05-01T11:56:35.000Z | 2020-06-18T16:06:40.000Z | tests/allen/models/target_sentiment/interactive_attention_network_test.py | apmoore1/target-extraction | 4139ecdc432411fcc4ed2723f4165e7dae93544d | [
"Apache-2.0"
] | 1 | 2019-07-11T07:16:09.000Z | 2019-07-11T07:16:09.000Z | import copy
from pathlib import Path
import tempfile
from allennlp.common.testing import ModelTestCase
from allennlp.common.params import Params
from allennlp.data import Batch
from allennlp.data.vocabulary import Vocabulary
from allennlp.models import Model
from allennlp.nn import InitializerApplicator, Initializer
f... | 51.987342 | 113 | 0.672023 | import copy
from pathlib import Path
import tempfile
from allennlp.common.testing import ModelTestCase
from allennlp.common.params import Params
from allennlp.data import Batch
from allennlp.data.vocabulary import Vocabulary
from allennlp.models import Model
from allennlp.nn import InitializerApplicator, Initializer
f... | 11,175 | 638 | 23 |
5a5a368b715d4c39ada8f4382251fe387fb6060e | 9,691 | py | Python | legocollector/utils/ldraw_studcount_parser.py | ericziethen/legocollector | 06aa984a5998979e7aa9c59e94a38633d653de55 | [
"MIT"
] | 1 | 2020-12-21T22:23:09.000Z | 2020-12-21T22:23:09.000Z | legocollector/utils/ldraw_studcount_parser.py | ericziethen/legocollector | 06aa984a5998979e7aa9c59e94a38633d653de55 | [
"MIT"
] | 150 | 2019-08-28T20:20:01.000Z | 2020-07-12T07:09:05.000Z | legocollector/utils/ldraw_studcount_parser.py | ericziethen/legocollector | 06aa984a5998979e7aa9c59e94a38633d653de55 | [
"MIT"
] | null | null | null | import datetime
import enum
import json
import os
from pathlib import Path, PureWindowsPath
class SubfileMissingError(Exception):
"""Subfile is Missing Exception."""
@enum.unique
@enum.unique
if __name__ == '__main__':
create_json_for_parts('ldraw_studcount.json')
| 34.610714 | 113 | 0.664947 | import datetime
import enum
import json
import os
from pathlib import Path, PureWindowsPath
class SubfileMissingError(Exception):
"""Subfile is Missing Exception."""
@enum.unique
class LineType(enum.Enum):
# pylint: disable=invalid-name
UNKNOWN = 'Unknown'
COMMENT = 'Comments'
PART = 'Parts'
... | 8,406 | 641 | 351 |
7b043494596b25f963b20398e2951a5146e7817c | 667 | py | Python | schemas/__init__.py | zakharovadaria/receipts | a1ac0936d8df4191c5500b605341e6380276595d | [
"MIT"
] | 2 | 2020-02-01T17:42:23.000Z | 2020-02-01T18:09:00.000Z | schemas/__init__.py | zakharovadaria/receipts | a1ac0936d8df4191c5500b605341e6380276595d | [
"MIT"
] | null | null | null | schemas/__init__.py | zakharovadaria/receipts | a1ac0936d8df4191c5500b605341e6380276595d | [
"MIT"
] | null | null | null | from marshmallow import fields, Schema
| 25.653846 | 66 | 0.698651 | from marshmallow import fields, Schema
class IngredientClientSchema(Schema):
id = fields.Integer()
name = fields.String()
calories = fields.Float()
class ReceiptClientSchema(Schema):
id = fields.Integer()
name = fields.String()
description = fields.String()
calories = fields.Float()
... | 0 | 556 | 69 |
527e60dff45fbe65ad00cb7bdb5100fc06d0b325 | 5,782 | py | Python | pawnshop_management/pawnshop_management/custom_codes/update_pawn_ticket.py | gpRabie/pawnshop_management | 0f23246d25a448aaa28108888c0d4e31b668680b | [
"MIT"
] | null | null | null | pawnshop_management/pawnshop_management/custom_codes/update_pawn_ticket.py | gpRabie/pawnshop_management | 0f23246d25a448aaa28108888c0d4e31b668680b | [
"MIT"
] | null | null | null | pawnshop_management/pawnshop_management/custom_codes/update_pawn_ticket.py | gpRabie/pawnshop_management | 0f23246d25a448aaa28108888c0d4e31b668680b | [
"MIT"
] | 1 | 2022-03-18T06:50:55.000Z | 2022-03-18T06:50:55.000Z | import frappe
from frappe.utils import today
@frappe.whitelist()
@frappe.whitelist()
@frappe.whitelist()
@frappe.whitelist()
@frappe.whitelist()
@frappe.whitelist()
@frappe.whitelist() | 45.888889 | 116 | 0.686095 | import frappe
from frappe.utils import today
@frappe.whitelist()
def update_pawn_tickets():
non_jewelry = frappe.db.get_all('Pawn Ticket Non Jewelry',
filters={
'workflow_state': 'Active'
},
pluck='name')
for i in range(len(non_jewelry)):
pawn_ticket=frappe.get_doc... | 5,403 | 0 | 177 |
ab2e980d063fadd423ad05029f6ef28ce4c04c33 | 918 | py | Python | exchange_rates/cbr_ru_parse.py | DazEB2/SimplePyScripts | 1dde0a42ba93fe89609855d6db8af1c63b1ab7cc | [
"CC-BY-4.0"
] | null | null | null | exchange_rates/cbr_ru_parse.py | DazEB2/SimplePyScripts | 1dde0a42ba93fe89609855d6db8af1c63b1ab7cc | [
"CC-BY-4.0"
] | null | null | null | exchange_rates/cbr_ru_parse.py | DazEB2/SimplePyScripts | 1dde0a42ba93fe89609855d6db8af1c63b1ab7cc | [
"CC-BY-4.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'ipetrash'
"""Парсер курса доллара и евро за текущую дату от сайта центробанка России."""
if __name__ == '__main__':
from datetime import date
date_req = date.today().strftime('%d.%m.%Y')
url = 'https://www.cbr.ru/currency_base/daily.aspx?date... | 27.818182 | 94 | 0.627451 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'ipetrash'
"""Парсер курса доллара и евро за текущую дату от сайта центробанка России."""
if __name__ == '__main__':
from datetime import date
date_req = date.today().strftime('%d.%m.%Y')
url = 'https://www.cbr.ru/currency_base/daily.aspx?date... | 0 | 0 | 0 |
b9c02aafcf9306ad0a58a74e54efbdd70e3772e4 | 7,030 | py | Python | tests/rackdiag/test_latex.py | tk0miya/sphinxcontrib-nwdiag | 14c31c07e643d0402ba048bfb0bd445f07775abd | [
"BSD-2-Clause"
] | 4 | 2018-03-12T18:59:41.000Z | 2020-03-06T02:37:54.000Z | tests/rackdiag/test_latex.py | tk0miya/sphinxcontrib-nwdiag | 14c31c07e643d0402ba048bfb0bd445f07775abd | [
"BSD-2-Clause"
] | 4 | 2018-02-14T21:22:43.000Z | 2019-12-10T17:03:10.000Z | tests/rackdiag/test_latex.py | tk0miya/sphinxcontrib-nwdiag | 14c31c07e643d0402ba048bfb0bd445f07775abd | [
"BSD-2-Clause"
] | 3 | 2017-05-26T05:45:30.000Z | 2019-08-21T05:53:32.000Z | # -*- coding: utf-8 -*-
import os
import re
from sphinx_testing import with_app
import unittest
CR = '\r?\n'
rackdiag_fontpath = '/usr/share/fonts/truetype/ipafont/ipagp.ttf'
with_png_app = with_app(srcdir='tests/docs/rackdiag',
buildername='latex',
write_docstring=Tr... | 33.798077 | 105 | 0.503841 | # -*- coding: utf-8 -*-
import os
import re
from sphinx_testing import with_app
import unittest
CR = '\r?\n'
rackdiag_fontpath = '/usr/share/fonts/truetype/ipafont/ipagp.ttf'
with_png_app = with_app(srcdir='tests/docs/rackdiag',
buildername='latex',
write_docstring=Tr... | 0 | 5,619 | 23 |
de2cd8bb23534894e920c8019c253623de843d7d | 7,864 | py | Python | tools/RNN/rnn_quantizer/tensorflow/tf_nndct/graph/op_def.py | hito0512/Vitis-AI | 996459fb96cb077ed2f7e789d515893b1cccbc95 | [
"Apache-2.0"
] | 1 | 2022-02-17T22:13:23.000Z | 2022-02-17T22:13:23.000Z | tools/RNN/rnn_quantizer/tensorflow/tf_nndct/graph/op_def.py | hito0512/Vitis-AI | 996459fb96cb077ed2f7e789d515893b1cccbc95 | [
"Apache-2.0"
] | null | null | null | tools/RNN/rnn_quantizer/tensorflow/tf_nndct/graph/op_def.py | hito0512/Vitis-AI | 996459fb96cb077ed2f7e789d515893b1cccbc95 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 Xilinx Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 24.196923 | 79 | 0.675865 | # Copyright 2019 Xilinx Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 3,381 | 3,076 | 397 |
1a59477b39e10e1a0a4e33a5c9745ef9b0cb9cdd | 12,063 | py | Python | huntsman_dust/utils.py | lspitler/huntsman-dust | 523d439937ef45856df023451e8dfae8088211de | [
"MIT"
] | null | null | null | huntsman_dust/utils.py | lspitler/huntsman-dust | 523d439937ef45856df023451e8dfae8088211de | [
"MIT"
] | 4 | 2018-07-28T17:37:57.000Z | 2018-07-28T22:59:35.000Z | huntsman_dust/utils.py | lspitler/huntsman-dust | 523d439937ef45856df023451e8dfae8088211de | [
"MIT"
] | 1 | 2019-07-06T10:27:51.000Z | 2019-07-06T10:27:51.000Z | import os
import numpy as np
from scipy import fftpack
import matplotlib.pyplot as plt
from astropy.io import fits
from astropy.wcs import WCS
from astropy.stats import SigmaClip
from astropy.stats import gaussian_fwhm_to_sigma
from astropy.convolution import Gaussian2DKernel
from astropy.coordinates import SkyCoord
fr... | 35.06686 | 79 | 0.569842 | import os
import numpy as np
from scipy import fftpack
import matplotlib.pyplot as plt
from astropy.io import fits
from astropy.wcs import WCS
from astropy.stats import SigmaClip
from astropy.stats import gaussian_fwhm_to_sigma
from astropy.convolution import Gaussian2DKernel
from astropy.coordinates import SkyCoord
fr... | 0 | 0 | 0 |
61fcb32f380abdc8521d7acfae33943791a5d3f0 | 1,629 | py | Python | src/commands/command.py | an-dyy/lefi-bot | 07f1b97d009dcc3fb8ec52eb14d4503861ac8a74 | [
"MIT"
] | 3 | 2021-07-26T03:28:40.000Z | 2021-07-29T08:16:02.000Z | src/commands/command.py | an-dyy/lefi-bot | 07f1b97d009dcc3fb8ec52eb14d4503861ac8a74 | [
"MIT"
] | null | null | null | src/commands/command.py | an-dyy/lefi-bot | 07f1b97d009dcc3fb8ec52eb14d4503861ac8a74 | [
"MIT"
] | 1 | 2021-07-29T07:50:12.000Z | 2021-07-29T07:50:12.000Z | from __future__ import annotations
import typing as t
if t.TYPE_CHECKING:
from .context import Context
from ..utils import maybe_coro
__all__ = ("Command",)
| 28.578947 | 88 | 0.603438 | from __future__ import annotations
import typing as t
if t.TYPE_CHECKING:
from .context import Context
from ..utils import maybe_coro
__all__ = ("Command",)
class Command:
def __init__(self, *args, **kwargs):
self.callback: t.Callable[..., t.Coroutine] = kwargs.pop("callback")
self._name: ... | 1,248 | 168 | 46 |
09e44bdb7cfc402463b469a9c5bedc0ad1f08c57 | 1,017 | py | Python | day-03/part-1/alsyia.py | lypnol/adventofcode-2017 | 03ced3df3eb80e5c7965c4120e3932919067cb15 | [
"MIT"
] | 16 | 2017-12-02T11:56:25.000Z | 2018-02-10T15:09:23.000Z | day-03/part-1/alsyia.py | lypnol/adventofcode-2017 | 03ced3df3eb80e5c7965c4120e3932919067cb15 | [
"MIT"
] | 19 | 2017-12-01T07:54:22.000Z | 2017-12-19T17:41:02.000Z | day-03/part-1/alsyia.py | lypnol/adventofcode-2017 | 03ced3df3eb80e5c7965c4120e3932919067cb15 | [
"MIT"
] | 4 | 2017-12-04T23:58:12.000Z | 2018-02-01T08:53:16.000Z | from runners.python import Submission
| 23.651163 | 69 | 0.692232 | from runners.python import Submission
class AlsyiaSubmission(Submission):
def findSpiraleLayer(self, number):
layerMaxValue = 1
layerNumber = 0
while(layerMaxValue < number):
layerNumber += 1
layerMaxValue += 8*layerNumber
return (layerNumber, layerMaxValue)
def findCoordinates(self, number, layer... | 869 | 14 | 95 |
47f8b3bceef1e3a48cc579576eef97e0f4bd0c4b | 1,320 | py | Python | internal/handlers/estonia.py | fillingthemoon/cartogram-web | 58b645bca0c22b9bccdb2a5a8213a5a24a7e5958 | [
"MIT"
] | null | null | null | internal/handlers/estonia.py | fillingthemoon/cartogram-web | 58b645bca0c22b9bccdb2a5a8213a5a24a7e5958 | [
"MIT"
] | 20 | 2019-10-20T11:27:38.000Z | 2022-03-12T00:28:17.000Z | internal/handlers/estonia.py | fillingthemoon/cartogram-web | 58b645bca0c22b9bccdb2a5a8213a5a24a7e5958 | [
"MIT"
] | 16 | 2019-08-22T04:49:44.000Z | 2021-06-09T04:44:57.000Z | import settings
import handlers.base_handler
import csv
| 28.085106 | 441 | 0.605303 | import settings
import handlers.base_handler
import csv
class CartogramHandler(handlers.base_handler.BaseCartogramHandler):
def get_name(self):
return "Estonia"
def get_gen_file(self):
return "{}/est_processedmap.json".format(settings.CARTOGRAM_DATA_DIR)
def validate_values(self, val... | 1,021 | 46 | 197 |
baa4372c438f3d6d2e4fafac88336e8b69c43e51 | 1,991 | py | Python | recognition/arcface_paddle/dynamic/utils/data_parallel.py | qaz734913414/insightface | 4101fe608ca1d38604a23d53f32314ce8a28fe79 | [
"MIT"
] | 12,377 | 2017-12-04T02:46:57.000Z | 2022-03-31T16:48:31.000Z | recognition/arcface_paddle/dynamic/utils/data_parallel.py | qaz734913414/insightface | 4101fe608ca1d38604a23d53f32314ce8a28fe79 | [
"MIT"
] | 1,851 | 2017-12-05T05:41:23.000Z | 2022-03-30T13:06:22.000Z | recognition/arcface_paddle/dynamic/utils/data_parallel.py | qaz734913414/insightface | 4101fe608ca1d38604a23d53f32314ce8a28fe79 | [
"MIT"
] | 4,198 | 2017-12-05T02:57:19.000Z | 2022-03-30T10:29:37.000Z | # Copyright (c) 2021 PaddlePaddle 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 appli... | 34.929825 | 80 | 0.683074 | # Copyright (c) 2021 PaddlePaddle 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 appli... | 1,282 | 0 | 44 |
b839e91cbc1b50e7916c464f7be1a596a4a43767 | 5,332 | py | Python | data_transformer.py | dozsam13/LHYP | af7115c115fdff51399b83cd1a515bf2c6f7879d | [
"MIT"
] | null | null | null | data_transformer.py | dozsam13/LHYP | af7115c115fdff51399b83cd1a515bf2c6f7879d | [
"MIT"
] | null | null | null | data_transformer.py | dozsam13/LHYP | af7115c115fdff51399b83cd1a515bf2c6f7879d | [
"MIT"
] | null | null | null | from con_reader import CONreaderVM
from dicom_reader import DCMreaderVM
from utils import get_logger
from domain.patient_data import PatientData
import numpy as np
import pickle
import os
import sys
import cv2 as cv
logger = get_logger(__name__)
in_dir = sys.argv[1]
out_dir = sys.argv[2]
if not os.path.isdir(in_dir)... | 41.015385 | 131 | 0.722243 | from con_reader import CONreaderVM
from dicom_reader import DCMreaderVM
from utils import get_logger
from domain.patient_data import PatientData
import numpy as np
import pickle
import os
import sys
import cv2 as cv
logger = get_logger(__name__)
def create_path_for_file(pickle_file_path):
os.makedirs(os.path.dirn... | 4,584 | 0 | 184 |
2df13fe1d28bde75632e035392de59d9ff455bad | 1,726 | py | Python | week_data.py | vv31415926/lesson_15_Pro | f792b42c1b9f550bd1323d01c0587cd5c91ea2f7 | [
"MIT"
] | null | null | null | week_data.py | vv31415926/lesson_15_Pro | f792b42c1b9f550bd1323d01c0587cd5c91ea2f7 | [
"MIT"
] | null | null | null | week_data.py | vv31415926/lesson_15_Pro | f792b42c1b9f550bd1323d01c0587cd5c91ea2f7 | [
"MIT"
] | null | null | null | from day_data import DayData
import datetime
# получить планы на указанный день недели - смещение от текущего
if __name__ == '__main__':
wd = WeekData()
print( wd.get_plan_day( 0 ) )
print( wd.get_plan_day( 1 ) )
print( wd.get_plan_day( 2 ) )
print( wd.get_plan_day( 3 ) )
print( wd.get_p... | 33.843137 | 71 | 0.579374 | from day_data import DayData
import datetime
class WeekData:
def __init__(self):
today = datetime.datetime.today()
self.selected_day = today.strftime("%w")
self.to_week = {'1': DayData(), '2': DayData(), '3': DayData(),
'4': DayData(), '5': DayData(), '6': DayData()... | 1,201 | -6 | 129 |
8fca43ede734b63205929aa9b18ba8e68b3bb003 | 4,259 | py | Python | tool/draw_box.py | YujieLu10/tslam | 1341dbecdf02ee6b1b6cdd1a538272fffdea6ffd | [
"Apache-2.0"
] | null | null | null | tool/draw_box.py | YujieLu10/tslam | 1341dbecdf02ee6b1b6cdd1a538272fffdea6ffd | [
"Apache-2.0"
] | null | null | null | tool/draw_box.py | YujieLu10/tslam | 1341dbecdf02ee6b1b6cdd1a538272fffdea6ffd | [
"Apache-2.0"
] | null | null | null | import matplotlib.pyplot as plt
import numpy as np
import math
import os
np.set_printoptions(threshold=np.inf)
# prepare some coordinates
# [3, 4, 13, 14, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 154, 155, 156, 157, 158]
# 2 2 2
# /home/jianrenw/prox/tslam/data/local/agent/20210506/resetnormal/gtsample/voxel... | 37.690265 | 280 | 0.667528 | import matplotlib.pyplot as plt
import numpy as np
import math
import os
np.set_printoptions(threshold=np.inf)
# prepare some coordinates
# [3, 4, 13, 14, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 154, 155, 156, 157, 158]
# 2 2 2
# /home/jianrenw/prox/tslam/data/local/agent/20210506/resetnormal/gtsample/voxel... | 0 | 0 | 0 |
1fb06c917bb3ee4d9acd325afe9667ea4c2437e1 | 1,030 | py | Python | char blackness.py | UnsignedByte/Ascii-Art-Generator | 76b5c40692580d0e65b9667037c81c182d0a202a | [
"MIT"
] | null | null | null | char blackness.py | UnsignedByte/Ascii-Art-Generator | 76b5c40692580d0e65b9667037c81c182d0a202a | [
"MIT"
] | null | null | null | char blackness.py | UnsignedByte/Ascii-Art-Generator | 76b5c40692580d0e65b9667037c81c182d0a202a | [
"MIT"
] | null | null | null | from PIL import Image,ImageDraw,ImageFont
import os
grayscale=[]
unicodeblocks = [(32,126),(174,846),(910,1366),(1421,1479),(5761,5788),(6656,6678),(7680,7957),(8448,8587),(9312,9472),(9696,10495),(10854,10956),(12032,12245),(11200,11208)]
for block in unicodeblocks:
for i in range(block[0],block[1]+1):
to... | 38.148148 | 174 | 0.635922 | from PIL import Image,ImageDraw,ImageFont
import os
grayscale=[]
unicodeblocks = [(32,126),(174,846),(910,1366),(1421,1479),(5761,5788),(6656,6678),(7680,7957),(8448,8587),(9312,9472),(9696,10495),(10854,10956),(12032,12245),(11200,11208)]
for block in unicodeblocks:
for i in range(block[0],block[1]+1):
to... | 0 | 0 | 0 |
0fbdd277db2c9e011fc459817c0381adbcdfb892 | 2,867 | py | Python | tests/transformation/test_infer_datatypes.py | fpjentzsch/finn-base | 7cd7e00ba6709a85073ba22beeb5827e684fe085 | [
"BSD-3-Clause"
] | 23 | 2020-10-15T13:23:39.000Z | 2022-03-09T16:36:58.000Z | tests/transformation/test_infer_datatypes.py | fpjentzsch/finn-base | 7cd7e00ba6709a85073ba22beeb5827e684fe085 | [
"BSD-3-Clause"
] | 23 | 2020-10-15T13:32:29.000Z | 2022-02-21T15:51:19.000Z | tests/transformation/test_infer_datatypes.py | fpjentzsch/finn-base | 7cd7e00ba6709a85073ba22beeb5827e684fe085 | [
"BSD-3-Clause"
] | 14 | 2020-10-15T13:27:54.000Z | 2021-12-27T04:52:25.000Z | # Copyright (c) 2020, Xilinx
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# list of conditions and the follow... | 51.196429 | 84 | 0.779909 | # Copyright (c) 2020, Xilinx
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# list of conditions and the follow... | 941 | 0 | 23 |
8e0fe7f0809c8c710373ef72b05422507b0c1188 | 3,258 | py | Python | List-1.py | HermanSanghera18/CodingBatPy | fe30edf8c2b5dfb4bac771a875e78edac074d1f6 | [
"MIT"
] | null | null | null | List-1.py | HermanSanghera18/CodingBatPy | fe30edf8c2b5dfb4bac771a875e78edac074d1f6 | [
"MIT"
] | null | null | null | List-1.py | HermanSanghera18/CodingBatPy | fe30edf8c2b5dfb4bac771a875e78edac074d1f6 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Herman Sanghera
November 2, 2019
CodingBat Solutions (Python)
This is a python file containing my own solutions to the
different Python List-1 exercises on codingbat.com
"""
"""
List-1 > first_last6:
Given an array of ints, return True if 6 appears as
either the first or las... | 23.106383 | 69 | 0.635973 | # -*- coding: utf-8 -*-
"""
Herman Sanghera
November 2, 2019
CodingBat Solutions (Python)
This is a python file containing my own solutions to the
different Python List-1 exercises on codingbat.com
"""
"""
List-1 > first_last6:
Given an array of ints, return True if 6 appears as
either the first or las... | 840 | 0 | 276 |
f4143c5584db391ca9e4d9ea7c3406a15b065e22 | 209 | py | Python | chocolatepy/__init__.py | chinapandaman/chocolatepy | 9dc53f41ad877606601620cc45852d9c931947d9 | [
"MIT"
] | null | null | null | chocolatepy/__init__.py | chinapandaman/chocolatepy | 9dc53f41ad877606601620cc45852d9c931947d9 | [
"MIT"
] | 4 | 2020-09-23T23:26:50.000Z | 2020-09-26T23:41:32.000Z | chocolatepy/__init__.py | chinapandaman/chocolatepy | 9dc53f41ad877606601620cc45852d9c931947d9 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from app import (ChocolateApp, DatabaseNotEnabledError,
InvalidAuthSettingsError, InvalidPyDALParameterError)
from server import ChocolateServer, NonChocolateAppError
| 34.833333 | 70 | 0.760766 | # -*- coding: utf-8 -*-
from app import (ChocolateApp, DatabaseNotEnabledError,
InvalidAuthSettingsError, InvalidPyDALParameterError)
from server import ChocolateServer, NonChocolateAppError
| 0 | 0 | 0 |
0eb54262d8c4521a2d93d661774314cb767ce4e5 | 2,888 | py | Python | Backend/app/helpers/allhelpers.py | WrathTitan/twentyone | 22665214b2e7699d9c785b22174bdab8992cbb7d | [
"MIT"
] | 9 | 2020-11-10T14:21:44.000Z | 2021-10-02T13:12:50.000Z | Backend/app/helpers/allhelpers.py | WrathTitan/twentyone | 22665214b2e7699d9c785b22174bdab8992cbb7d | [
"MIT"
] | null | null | null | Backend/app/helpers/allhelpers.py | WrathTitan/twentyone | 22665214b2e7699d9c785b22174bdab8992cbb7d | [
"MIT"
] | 7 | 2020-11-14T08:19:53.000Z | 2021-08-11T14:41:37.000Z | import os
| 26.018018 | 149 | 0.671053 | import os
def ResponseModel(data,message):
return {
"data": [data],
"code":200,
"message":message,
}
def ErrorResponseModel(error, code, message):
return {
"error": error,
"code": code,
"message": message
}
def serialiseDict(item) -> dict:
return {... | 2,075 | -6 | 804 |
e52d19560780678b5e09cc688f4d2c6faa164ad8 | 2,340 | py | Python | src/management/commands/stats.py | DasLab/django-RMDB-server | a07f314fe929a7d856032e5c07ff3c6876ec9b6c | [
"BSD-Source-Code"
] | 3 | 2017-07-10T03:45:59.000Z | 2022-03-10T11:32:27.000Z | src/management/commands/stats.py | DasLab/django-RMDB-server | a07f314fe929a7d856032e5c07ff3c6876ec9b6c | [
"BSD-Source-Code"
] | 38 | 2017-12-12T20:15:51.000Z | 2021-07-09T19:48:53.000Z | src/management/commands/stats.py | DasLab/django-RMDB-server | a07f314fe929a7d856032e5c07ff3c6876ec9b6c | [
"BSD-Source-Code"
] | 3 | 2017-06-23T05:46:36.000Z | 2022-01-08T07:12:00.000Z | import shutil
import simplejson
import sys
import time
import traceback
from django.core.management.base import BaseCommand
from src.settings import *
from src.util.stats import *
| 48.75 | 154 | 0.633333 | import shutil
import simplejson
import sys
import time
import traceback
from django.core.management.base import BaseCommand
from src.settings import *
from src.util.stats import *
class Command(BaseCommand):
help = 'Cache RMDB statistics and browse JSON.'
def handle(self, *args, **options):
t0 = ti... | 2,048 | 85 | 23 |
32a11c5b7c864780f2fb04dbe1e89129696e4682 | 752 | py | Python | src/lambda_functions/bot_tester/run_conversation_test.py | aws-samples/aws-lex-v2-bot-analytics | e91eab683bc539dbea8e35904c5d43e99975636c | [
"MIT-0",
"BSD-3-Clause"
] | 6 | 2021-08-28T01:36:32.000Z | 2022-02-14T00:37:16.000Z | src/lambda_functions/bot_tester/run_conversation_test.py | aws-samples/aws-lex-v2-bot-analytics | e91eab683bc539dbea8e35904c5d43e99975636c | [
"MIT-0",
"BSD-3-Clause"
] | null | null | null | src/lambda_functions/bot_tester/run_conversation_test.py | aws-samples/aws-lex-v2-bot-analytics | e91eab683bc539dbea8e35904c5d43e99975636c | [
"MIT-0",
"BSD-3-Clause"
] | 1 | 2022-01-24T18:53:40.000Z | 2022-01-24T18:53:40.000Z | #!/usr/bin/env python3.8
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: MIT-0
"""Lex Bot Conversation Runner"""
import boto3
from botocore.config import Config as BotoCoreConfig
CLIENT_CONFIG = BotoCoreConfig(
retries={"mode": "adaptive", "max_attempts": 5},
)
CLIEN... | 32.695652 | 88 | 0.726064 | #!/usr/bin/env python3.8
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: MIT-0
"""Lex Bot Conversation Runner"""
import boto3
from botocore.config import Config as BotoCoreConfig
CLIENT_CONFIG = BotoCoreConfig(
retries={"mode": "adaptive", "max_attempts": 5},
)
CLIEN... | 0 | 0 | 0 |
d224735ac679c349fb3a7a3afe16fe37810ddc75 | 14,564 | py | Python | d2/rest.py | wofmanaf/ResT | 508e30b28036e2cb882a03d24268dc70eb0c82a3 | [
"Apache-2.0"
] | 178 | 2021-05-31T01:26:17.000Z | 2022-03-30T09:28:01.000Z | d2/rest.py | wofmanaf/ResT | 508e30b28036e2cb882a03d24268dc70eb0c82a3 | [
"Apache-2.0"
] | 20 | 2021-05-31T09:40:56.000Z | 2022-03-07T09:24:51.000Z | d2/rest.py | wofmanaf/ResT | 508e30b28036e2cb882a03d24268dc70eb0c82a3 | [
"Apache-2.0"
] | 20 | 2021-05-31T03:35:02.000Z | 2022-03-15T11:25:29.000Z | import torch
import torch.nn as nn
from timm.models.layers import DropPath, to_2tuple, trunc_normal_
from detectron2.modeling.backbone import Backbone
from detectron2.modeling.backbone.build import BACKBONE_REGISTRY
from detectron2.modeling.backbone.fpn import FPN, LastLevelP6P7, LastLevelMaxPool
from detectron2.layer... | 37.536082 | 119 | 0.595235 | import torch
import torch.nn as nn
from timm.models.layers import DropPath, to_2tuple, trunc_normal_
from detectron2.modeling.backbone import Backbone
from detectron2.modeling.backbone.build import BACKBONE_REGISTRY
from detectron2.modeling.backbone.fpn import FPN, LastLevelP6P7, LastLevelMaxPool
from detectron2.layer... | 10,818 | 13 | 563 |
8d29172c1c5d24d623d0c21dff8ad1a1b5dfd9dd | 1,612 | py | Python | support/runtests.py | EDRN/PublicPortal | c78cdd97a1061ad6c84fac5413df9d1022b38a1c | [
"Apache-2.0"
] | null | null | null | support/runtests.py | EDRN/PublicPortal | c78cdd97a1061ad6c84fac5413df9d1022b38a1c | [
"Apache-2.0"
] | null | null | null | support/runtests.py | EDRN/PublicPortal | c78cdd97a1061ad6c84fac5413df9d1022b38a1c | [
"Apache-2.0"
] | null | null | null | # encoding: utf-8
# Copyright 2009 California Institute of Technology. ALL RIGHTS
# RESERVED. U.S. Government Sponsorship acknowledged.
#
# Run EDRN Public Portal tests
import subprocess, os, os.path, sys, ConfigParser
_executable = os.path.join('bin', 'instance-debug')
_logDir = os.path.join('var', 'testlogs')
def ... | 30.415094 | 86 | 0.602978 | # encoding: utf-8
# Copyright 2009 California Institute of Technology. ALL RIGHTS
# RESERVED. U.S. Government Sponsorship acknowledged.
#
# Run EDRN Public Portal tests
import subprocess, os, os.path, sys, ConfigParser
_executable = os.path.join('bin', 'instance-debug')
_logDir = os.path.join('var', 'testlogs')
def ... | 0 | 0 | 0 |
ce7d0120d0cbc128983d7d15fdb26919e66fd359 | 7,182 | py | Python | yue/core/settings.py | nsetzer/YueMusicPlayer | feaf6fe5c046b1a7f6b7774d4e86a2fbb1e431cf | [
"MIT"
] | null | null | null | yue/core/settings.py | nsetzer/YueMusicPlayer | feaf6fe5c046b1a7f6b7774d4e86a2fbb1e431cf | [
"MIT"
] | null | null | null | yue/core/settings.py | nsetzer/YueMusicPlayer | feaf6fe5c046b1a7f6b7774d4e86a2fbb1e431cf | [
"MIT"
] | 1 | 2019-03-06T14:29:27.000Z | 2019-03-06T14:29:27.000Z |
from .sqlstore import SQLTable, SQLView
K_STR=1 # a single string value
K_INT=2 # a numeric field
K_CSV=3 #
class Settings(object):
"""Application Settings backed by a database
provides a basic key/value store for Strings, Integers, and List-Of-Strings
"""
__instance = None
@staticmethod
... | 31.778761 | 95 | 0.524088 |
from .sqlstore import SQLTable, SQLView
K_STR=1 # a single string value
K_INT=2 # a numeric field
K_CSV=3 #
class Settings(object):
"""Application Settings backed by a database
provides a basic key/value store for Strings, Integers, and List-Of-Strings
"""
__instance = None
def __init__(self, ... | 4,516 | 0 | 349 |
d29c2d81f7eb9c0075421901b49ee41bee26f647 | 532 | py | Python | cogs/admin.py | jessemillar/StretchReminderDiscord | a20b06bf19a35c36ca47b05cbfbf2e83d292e597 | [
"MIT"
] | null | null | null | cogs/admin.py | jessemillar/StretchReminderDiscord | a20b06bf19a35c36ca47b05cbfbf2e83d292e597 | [
"MIT"
] | 5 | 2022-02-20T04:32:03.000Z | 2022-02-20T20:00:33.000Z | cogs/admin.py | jessemillar/StretchReminderDiscord | a20b06bf19a35c36ca47b05cbfbf2e83d292e597 | [
"MIT"
] | 2 | 2018-02-23T16:46:02.000Z | 2022-02-18T23:08:00.000Z | from discord.ext import commands
| 26.6 | 81 | 0.642857 | from discord.ext import commands
class Admin(commands.Cog):
def __init__(self, bot):
self.bot = bot
def cog_check(self, ctx):
return self.bot.is_owner(ctx.author)
@commands.command()
async def reload(self, ctx, extension_name):
try:
self.bot.reload_extension(extens... | 344 | 109 | 46 |
447191263e7106c5185ab7b4546ec6b5e84a9105 | 7,883 | py | Python | Ensemble/BottomTrack.py | ricorx7/rti-python | 1316323b782ddb8df357e55404f507a9573e172c | [
"BSD-3-Clause"
] | 1 | 2017-06-10T13:27:44.000Z | 2017-06-10T13:27:44.000Z | Ensemble/BottomTrack.py | ricorx7/rti-python | 1316323b782ddb8df357e55404f507a9573e172c | [
"BSD-3-Clause"
] | 10 | 2019-12-28T18:06:18.000Z | 2022-03-25T18:48:20.000Z | Ensemble/BottomTrack.py | ricorx7/rti_python | 1316323b782ddb8df357e55404f507a9573e172c | [
"BSD-3-Clause"
] | null | null | null | from Ensemble.Ensemble import Ensemble
from log import logger
class BottomTrack:
"""
Ensemble Data DataSet.
Integer values that give details about the ensemble.
"""
def decode(self, data):
"""
Take the data bytearray. Decode the data to populate
the velocities.
:p... | 44.536723 | 147 | 0.639858 | from Ensemble.Ensemble import Ensemble
from log import logger
class BottomTrack:
"""
Ensemble Data DataSet.
Integer values that give details about the ensemble.
"""
def __init__(self, num_elements, element_multiplier):
self.ds_type = 10
self.num_elements = num_elements
sel... | 1,784 | 0 | 27 |
1cedfc9b6812105e0cddd73ad57c955adc3a5c8a | 4,358 | py | Python | 02_Python/DBSCAN.py | milaan9/Clustering_Algorithms_from_Scratch | b03cc6b302036653465d6e897352697f2e817b8c | [
"MIT"
] | 126 | 2021-12-02T13:32:46.000Z | 2022-03-14T13:43:35.000Z | 02_Python/DBSCAN.py | Lexie778/Clustering_Algorithms_from_Scratch | ec119a2522dc1dc7b097ecb269912f8d44387dbb | [
"MIT"
] | null | null | null | 02_Python/DBSCAN.py | Lexie778/Clustering_Algorithms_from_Scratch | ec119a2522dc1dc7b097ecb269912f8d44387dbb | [
"MIT"
] | 124 | 2021-12-02T13:32:48.000Z | 2022-03-06T17:04:02.000Z | # ================================================================================================================
# ----------------------------------------------------------------------------------------------------------------
# DBSCAN
# -----------------------------------------------------------... | 34.046875 | 123 | 0.47843 | # ================================================================================================================
# ----------------------------------------------------------------------------------------------------------------
# DBSCAN
# -----------------------------------------------------------... | 3,353 | 0 | 150 |
dbbebec78fc7013d0845a17fe8b66e49e3b41e98 | 544 | py | Python | plugins/pelican-page-order/page_order.py | chalkless/tdwg-website | b0be535fcd5acd48205da1982412a263ec3d7f01 | [
"CC-BY-4.0"
] | 12 | 2017-10-03T13:35:54.000Z | 2022-03-18T13:23:34.000Z | plugins/pelican-page-order/page_order.py | chalkless/tdwg-website | b0be535fcd5acd48205da1982412a263ec3d7f01 | [
"CC-BY-4.0"
] | 110 | 2017-08-11T12:54:00.000Z | 2022-03-20T22:04:20.000Z | plugins/pelican-page-order/page_order.py | chalkless/tdwg-website | b0be535fcd5acd48205da1982412a263ec3d7f01 | [
"CC-BY-4.0"
] | 59 | 2017-11-07T05:04:42.000Z | 2022-03-22T19:39:23.000Z | """
Page Order
==========
Adds a `page_order` attribute to all pages if one is not defined.
"""
from pelican import signals
| 24.727273 | 79 | 0.639706 | """
Page Order
==========
Adds a `page_order` attribute to all pages if one is not defined.
"""
from pelican import signals
def set_page_order(generator):
for page in generator.pages:
try:
page.page_order = int(page.page_order)
except:
if 'DEFAULT_PAGE_ORDER' in generator.... | 372 | 0 | 46 |
2830bd49dafb22b495bb8c269fb5b1baae22792c | 5,615 | py | Python | sidekick-experimental/sidekick/experimental/queue.py | fabiommendes/sidekick | 993ae7b8496347ad9720d3ff11e10ab946c3a800 | [
"MIT"
] | 32 | 2017-08-10T09:42:51.000Z | 2022-03-18T17:21:26.000Z | sidekick-experimental/sidekick/experimental/queue.py | fabiommendes/sidekick | 993ae7b8496347ad9720d3ff11e10ab946c3a800 | [
"MIT"
] | 1 | 2019-04-10T13:07:45.000Z | 2019-04-18T02:27:47.000Z | sidekick-experimental/sidekick/experimental/queue.py | fabiommendes/sidekick | 993ae7b8496347ad9720d3ff11e10ab946c3a800 | [
"MIT"
] | 5 | 2017-10-10T13:43:23.000Z | 2019-06-18T00:09:15.000Z | import collections.abc
import functools
from ..properties import lazy
from .linkedlist import List, Nil
def on_parts(func):
"""
Distribute methods on left and right parts.
"""
@functools.wraps(func)
return method
def as_list(func):
"""
Apply method as if queue was a list and return qu... | 28.647959 | 80 | 0.593054 | import collections.abc
import functools
from ..properties import lazy
from .linkedlist import List, Nil
def on_parts(func):
"""
Distribute methods on left and right parts.
"""
@functools.wraps(func)
def method(self, *args):
left = func(self._left, *args)
right = func(self._right,... | 846 | 0 | 241 |
f2d06cad6e38b1dbf12f2aa912a526d96ced214d | 5,775 | py | Python | litesession.py | bobuk/tcplanz | 80564d77e095d77347843c8a36c98f275e24c088 | [
"BSD-3-Clause"
] | 71 | 2015-11-15T07:15:57.000Z | 2022-03-19T02:12:09.000Z | litesession.py | bobuk/tcplanz | 80564d77e095d77347843c8a36c98f275e24c088 | [
"BSD-3-Clause"
] | 2 | 2018-07-27T10:15:16.000Z | 2020-10-02T08:56:01.000Z | litesession.py | bobuk/tcplanz | 80564d77e095d77347843c8a36c98f275e24c088 | [
"BSD-3-Clause"
] | 14 | 2016-12-05T07:53:41.000Z | 2022-01-12T06:43:26.000Z | #!/usr/bin/env pypy
import dpkt
import gzip
import zlib
import struct
import sys
from collections import defaultdict
from cStringIO import StringIO
from tcpsession import TCPSession, tcp_flags
| 29.464286 | 140 | 0.574026 | #!/usr/bin/env pypy
import dpkt
import gzip
import zlib
import struct
import sys
from collections import defaultdict
from cStringIO import StringIO
from tcpsession import TCPSession, tcp_flags
class LiteSession:
def __init__(self, num=0):
self.num=num
self.packed_content=list()
self.star... | 5,403 | -3 | 177 |
e2c9f620dd36af2ae12ae14166f285bc0c4b5cc6 | 10,642 | py | Python | discopy/argument_extract.py | mahmuduzzaman/discopy | 5bb0986d4f841aed6739fca5063ddfe6073920fa | [
"MIT"
] | null | null | null | discopy/argument_extract.py | mahmuduzzaman/discopy | 5bb0986d4f841aed6739fca5063ddfe6073920fa | [
"MIT"
] | null | null | null | discopy/argument_extract.py | mahmuduzzaman/discopy | 5bb0986d4f841aed6739fca5063ddfe6073920fa | [
"MIT"
] | null | null | null | import os
import pickle
import nltk
from discopy.confusion_matrix import *
from discopy.conn_head_mapper import *
from discopy.utils import discourse_adverbial, coordinating_connective, subordinating_connective
def extract_ps_arguments(clauses, conn_head, indices, ptree, arg2):
"""
If Arg1 is in the... | 37.471831 | 120 | 0.609002 | import os
import pickle
import nltk
from discopy.confusion_matrix import *
from discopy.conn_head_mapper import *
from discopy.utils import discourse_adverbial, coordinating_connective, subordinating_connective
def rootpath(clause):
path = ''
while clause.parent():
clause = clause.parent()
p... | 8,009 | 11 | 441 |
678660d95d5b76de0bb3535315dcb21ee5888802 | 7,276 | py | Python | main.py | XJay18/ResourceScheduling | 1139070f7469a0660cce4da1327fa6277eeec661 | [
"MIT"
] | null | null | null | main.py | XJay18/ResourceScheduling | 1139070f7469a0660cce4da1327fa6277eeec661 | [
"MIT"
] | null | null | null | main.py | XJay18/ResourceScheduling | 1139070f7469a0660cce4da1327fa6277eeec661 | [
"MIT"
] | null | null | null | from object.job import Job as Job1
from object.scheduler import Scheduler as Scheduler1
import os
import copy
import pickle
import argparse
INPUT_DIRECTORY = "input"
OUTPUT_DIRECTORY = "output"
if __name__ == '__main__':
arg = arg_parser()
if arg.method == "NMC":
if "task1" in arg.input_name:
... | 43.831325 | 102 | 0.629054 | from object.job import Job as Job1
from object.scheduler import Scheduler as Scheduler1
import os
import copy
import pickle
import argparse
INPUT_DIRECTORY = "input"
OUTPUT_DIRECTORY = "output"
def arg_parser():
parser = argparse.ArgumentParser(description="Resource scheduling problem in Hadoop.\n"
... | 5,501 | 0 | 115 |
58f2ac53e2095f1a18cecdc635e501a6c10052ea | 598 | py | Python | dnslambda_server.py | EmperorIrritant/dnslambda | 017941f56fecad539c0bfb2afff071944809f425 | [
"MIT"
] | null | null | null | dnslambda_server.py | EmperorIrritant/dnslambda | 017941f56fecad539c0bfb2afff071944809f425 | [
"MIT"
] | null | null | null | dnslambda_server.py | EmperorIrritant/dnslambda | 017941f56fecad539c0bfb2afff071944809f425 | [
"MIT"
] | null | null | null | import requests
from random import choice
import dns.message
import dns.query
import dns.rdatatype
dohservers = ['https://dns.google/dns-query', 'https://cloudflare-dns.com/dns-query', 'https://doh.appliedprivacy.net/query']
server = choice(dohservers)
| 33.222222 | 125 | 0.705686 | import requests
from random import choice
import dns.message
import dns.query
import dns.rdatatype
dohservers = ['https://dns.google/dns-query', 'https://cloudflare-dns.com/dns-query', 'https://doh.appliedprivacy.net/query']
server = choice(dohservers)
def lambda_handler(event, context):
qname = event["query"]["... | 320 | 0 | 23 |
3178dd15c40abdef210f245f4def820b1e53e95f | 184 | py | Python | problemsets/Codeforces/Python/M883.py | juarezpaulino/coderemite | a4649d3f3a89d234457032d14a6646b3af339ac1 | [
"Apache-2.0"
] | null | null | null | problemsets/Codeforces/Python/M883.py | juarezpaulino/coderemite | a4649d3f3a89d234457032d14a6646b3af339ac1 | [
"Apache-2.0"
] | null | null | null | problemsets/Codeforces/Python/M883.py | juarezpaulino/coderemite | a4649d3f3a89d234457032d14a6646b3af339ac1 | [
"Apache-2.0"
] | null | null | null | """
*
* Author: Juarez Paulino(coderemite)
* Email: juarez.paulino@gmail.com
*
"""
I=lambda:map(int,input().split())
a,b=I()
c,d=I()
print((max(1,abs(a-c))+max(1,abs(b-d))<<1)+4) | 18.4 | 45 | 0.592391 | """
*
* Author: Juarez Paulino(coderemite)
* Email: juarez.paulino@gmail.com
*
"""
I=lambda:map(int,input().split())
a,b=I()
c,d=I()
print((max(1,abs(a-c))+max(1,abs(b-d))<<1)+4) | 0 | 0 | 0 |
875bc5fc254aae0d24a24899b874f542004580a8 | 1,998 | py | Python | src/node/new_block_validation/new_block_validation.py | MikitaSaladukha/my-blockchain | c09091762dc559d41b8aa29fbe8267aff834a57c | [
"Apache-2.0"
] | null | null | null | src/node/new_block_validation/new_block_validation.py | MikitaSaladukha/my-blockchain | c09091762dc559d41b8aa29fbe8267aff834a57c | [
"Apache-2.0"
] | null | null | null | src/node/new_block_validation/new_block_validation.py | MikitaSaladukha/my-blockchain | c09091762dc559d41b8aa29fbe8267aff834a57c | [
"Apache-2.0"
] | null | null | null | from common.block import Block, BlockHeader
from common.io_blockchain import store_blockchain_in_memory
from common.values import NUMBER_OF_LEADING_ZEROS
from node.transaction_validation.transaction_validation import Transaction
| 39.176471 | 103 | 0.712713 | from common.block import Block, BlockHeader
from common.io_blockchain import store_blockchain_in_memory
from common.values import NUMBER_OF_LEADING_ZEROS
from node.transaction_validation.transaction_validation import Transaction
class NewBlockException(Exception):
def __init__(self, expression, message):
... | 1,526 | 8 | 233 |
171c579b875af90c8a1a2947774aaf9fab2561d0 | 1,687 | py | Python | project.py | lispcoc/pciutils.efi | 0292c9548edc91312322e9c0a201ab7f1e252429 | [
"BSD-3-Clause"
] | null | null | null | project.py | lispcoc/pciutils.efi | 0292c9548edc91312322e9c0a201ab7f1e252429 | [
"BSD-3-Clause"
] | null | null | null | project.py | lispcoc/pciutils.efi | 0292c9548edc91312322e9c0a201ab7f1e252429 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
#
# -*- coding: utf-8 -*-
# pylint: disable=invalid-name, line-too-long
#
# (c) 2019-2020 Timothy Lin <timothy.gh.lin@gmail.com>, BSD 3-Clause License.
#
"""
This is the project configuration file as well the starter script for iPug.
"""
import os
# These UDK tag source trees have been build-t... | 30.672727 | 99 | 0.554831 | #!/usr/bin/env python
#
# -*- coding: utf-8 -*-
# pylint: disable=invalid-name, line-too-long
#
# (c) 2019-2020 Timothy Lin <timothy.gh.lin@gmail.com>, BSD 3-Clause License.
#
"""
This is the project configuration file as well the starter script for iPug.
"""
import os
# These UDK tag source trees have been build-t... | 0 | 0 | 0 |
17d57503d909619aeef345f4aa00a016a2481518 | 1,920 | py | Python | extractfail.py | ihaveamac/FAIL | 4dda02803e8d851c3d6eca036a2007b34d975da7 | [
"Xnet",
"X11",
"CC-BY-4.0"
] | 3 | 2016-04-05T01:00:02.000Z | 2017-07-01T08:54:57.000Z | extractfail.py | ihaveamac/FAIL | 4dda02803e8d851c3d6eca036a2007b34d975da7 | [
"Xnet",
"X11",
"CC-BY-4.0"
] | null | null | null | extractfail.py | ihaveamac/FAIL | 4dda02803e8d851c3d6eca036a2007b34d975da7 | [
"Xnet",
"X11",
"CC-BY-4.0"
] | null | null | null | #!/usr/bin/env python2
import argparse, sys, os, binascii
if len(sys.argv) != 3:
print 'pick a file to extract and a directory to put all the files in'
print ' extractfail.py myarchive.fail directory'
sys.exit()
if not os.path.isfile(sys.argv[1]):
print sys.argv[1] + ' doesn\'t exist'
sys.exit()
... | 28.656716 | 74 | 0.680208 | #!/usr/bin/env python2
import argparse, sys, os, binascii
if len(sys.argv) != 3:
print 'pick a file to extract and a directory to put all the files in'
print ' extractfail.py myarchive.fail directory'
sys.exit()
if not os.path.isfile(sys.argv[1]):
print sys.argv[1] + ' doesn\'t exist'
sys.exit()
... | 0 | 0 | 0 |
5cb5044c3cf87647f883457a721d248700767b86 | 419 | py | Python | example/pwm_example.py | amaork/raspi-io | aaea4532569010a64f3c54036b9db7eb81515d1a | [
"MIT"
] | 8 | 2018-02-28T16:02:36.000Z | 2021-08-06T12:57:39.000Z | example/pwm_example.py | amaork/raspi-io | aaea4532569010a64f3c54036b9db7eb81515d1a | [
"MIT"
] | null | null | null | example/pwm_example.py | amaork/raspi-io | aaea4532569010a64f3c54036b9db7eb81515d1a | [
"MIT"
] | 1 | 2019-05-08T06:50:33.000Z | 2019-05-08T06:50:33.000Z | #!/usr/bin/env python3.5
import raspi_io.utility as utility
from raspi_io import SoftPWM, GPIO
if __name__ == '__main__':
address = utility.scan_server()[0]
pwm20 = SoftPWM(address, GPIO.BCM, 20, 500)
pwm21 = SoftPWM(address, GPIO.BCM, 21, 1000)
pwm21.start(100)
pwm21.start(50)
pwm21.start(10... | 19.952381 | 48 | 0.656325 | #!/usr/bin/env python3.5
import raspi_io.utility as utility
from raspi_io import SoftPWM, GPIO
if __name__ == '__main__':
address = utility.scan_server()[0]
pwm20 = SoftPWM(address, GPIO.BCM, 20, 500)
pwm21 = SoftPWM(address, GPIO.BCM, 21, 1000)
pwm21.start(100)
pwm21.start(50)
pwm21.start(10... | 0 | 0 | 0 |
0d436b8301dd7f3a492edd9ad87b09c10a37ced7 | 15,627 | py | Python | fpga/lib/pcie/tb/test_pcie_us_axil_master_256.py | totuwei/corundum | e983ad519fb4523d0ffca32f5e436195bcfc945c | [
"BSD-2-Clause-FreeBSD"
] | 544 | 2019-08-12T03:45:32.000Z | 2022-03-19T14:17:20.000Z | fpga/lib/pcie/tb/test_pcie_us_axil_master_256.py | akira2009999/corundum | cdc14769c33186c6d45fcd79b95c70889febff2b | [
"BSD-2-Clause-FreeBSD"
] | 78 | 2020-08-20T20:06:33.000Z | 2022-03-30T23:44:37.000Z | fpga/lib/pcie/tb/test_pcie_us_axil_master_256.py | akira2009999/corundum | cdc14769c33186c6d45fcd79b95c70889febff2b | [
"BSD-2-Clause-FreeBSD"
] | 142 | 2019-07-15T04:23:23.000Z | 2022-03-29T01:25:33.000Z | #!/usr/bin/env python
"""
Copyright (c) 2018 Alex Forencich
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merg... | 29.264045 | 117 | 0.621744 | #!/usr/bin/env python
"""
Copyright (c) 2018 Alex Forencich
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merg... | 14,134 | 0 | 46 |
13e60e46afd1997c82e669b8c2ad230ee34ef949 | 2,132 | py | Python | data.py | VUIIS/vxhr | 094785c97fbdcb17b34c821d5998a62d0f4c6c64 | [
"MIT"
] | 2 | 2015-06-21T03:50:41.000Z | 2016-03-06T05:11:18.000Z | data.py | VUIIS/vxhr | 094785c97fbdcb17b34c821d5998a62d0f4c6c64 | [
"MIT"
] | null | null | null | data.py | VUIIS/vxhr | 094785c97fbdcb17b34c821d5998a62d0f4c6c64 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
""" data.py
Functions for grabbing/manipulating/reporting on data
"""
__author__ = 'Scott Burns <scott.s.burns@vanderbilt.edu>'
__copyright__ = 'Copyright 2014 Vanderbilt University. All Rights Reserved'
import os
import pandas as pd
from redcap import Project
def get_... | 28.052632 | 77 | 0.680582 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
""" data.py
Functions for grabbing/manipulating/reporting on data
"""
__author__ = 'Scott Burns <scott.s.burns@vanderbilt.edu>'
__copyright__ = 'Copyright 2014 Vanderbilt University. All Rights Reserved'
import os
import pandas as pd
from redcap import Project
def get_... | 1,176 | 0 | 138 |
305bbf6706f23c17a6772494f9cfc745556e4ea5 | 3,162 | py | Python | tonegen/tonegen.py | abx393/doppler-demo | 257588f3f157643c6174eaae6f2535fa74b1a2ca | [
"MIT"
] | null | null | null | tonegen/tonegen.py | abx393/doppler-demo | 257588f3f157643c6174eaae6f2535fa74b1a2ca | [
"MIT"
] | null | null | null | tonegen/tonegen.py | abx393/doppler-demo | 257588f3f157643c6174eaae6f2535fa74b1a2ca | [
"MIT"
] | null | null | null | import wave, struct
import numpy as np
import scipy.signal as ss
import matplotlib.pyplot as plt
from tqdm import tqdm
if __name__ == '__main__':
fs = 48000 # sampling rate (Hz)
# duration = 20 # seconds
# N = int(duration * fs)
# n = np.arange(N)
# t = n / fs
# f = 21e3 # Hz
# samples ... | 27.495652 | 94 | 0.585705 | import wave, struct
import numpy as np
import scipy.signal as ss
import matplotlib.pyplot as plt
from tqdm import tqdm
def savemono(fname, samples, fs):
obj = wave.open(fname,'w')
obj.setnchannels(1) # mono
obj.setsampwidth(2)
obj.setframerate(fs)
samples *= 32767 / np.max(np.abs(samples))
fo... | 688 | 0 | 46 |
fabf7e00f1249b6bf20128ff9f585e469a59f706 | 392 | py | Python | tests/test_live_card.py | quapka/javus | 577e0c2dabfaea39d7ffacd42100d8a5f4cd738c | [
"MIT"
] | 1 | 2020-09-22T01:38:21.000Z | 2020-09-22T01:38:21.000Z | tests/test_live_card.py | petrs/javus | 6927c824d5e6b574a6a323c87bd5aa117eca5b00 | [
"MIT"
] | null | null | null | tests/test_live_card.py | petrs/javus | 6927c824d5e6b574a6a323c87bd5aa117eca5b00 | [
"MIT"
] | 1 | 2020-07-26T07:20:47.000Z | 2020-07-26T07:20:47.000Z | import pytest
# FIXME finish live testing
# due to the complexity of the JavaCard world we'll test the framework using a fixed and
# only example attack
LIVE_ATR = [59, 123, 24, 0, 0, 0, 49, 192, 100, 119, 227, 3, 0, 130, 144, 0]
@pytest.mark.live
@pytest.mark.live
| 19.6 | 88 | 0.696429 | import pytest
# FIXME finish live testing
# due to the complexity of the JavaCard world we'll test the framework using a fixed and
# only example attack
LIVE_ATR = [59, 123, 24, 0, 0, 0, 49, 192, 100, 119, 227, 3, 0, 130, 144, 0]
@pytest.mark.live
def test_using_correct_live_card():
pass
@pytest.mark.live
cl... | 48 | 1 | 70 |
08b2ce20ccddc41e40e1c3f62a0a1249a6e5167e | 1,800 | py | Python | authy/models.py | kelvin-daniel/instagram | 2ede5319266f4312a9440d4985d098bc7545c2ae | [
"MIT"
] | null | null | null | authy/models.py | kelvin-daniel/instagram | 2ede5319266f4312a9440d4985d098bc7545c2ae | [
"MIT"
] | null | null | null | authy/models.py | kelvin-daniel/instagram | 2ede5319266f4312a9440d4985d098bc7545c2ae | [
"MIT"
] | null | null | null | from django.db import models
from django.contrib.auth.models import User
from post.models import Post
from cloudinary.models import CloudinaryField
from django.db.models.signals import post_save
from PIL import Image
from django.conf import settings
import os
# Create your models here.
post_save.connect(c... | 35.294118 | 76 | 0.748889 | from django.db import models
from django.contrib.auth.models import User
from post.models import Post
from cloudinary.models import CloudinaryField
from django.db.models.signals import post_save
from PIL import Image
from django.conf import settings
import os
def user_directory_path(instance, filename):
... | 653 | 647 | 97 |
a9ed179f5de607526038cb750c8dea14f7458208 | 933 | py | Python | holobot/extensions/weather/models/condition_data.py | rexor12/holobot | 89b7b416403d13ccfeee117ef942426b08d3651d | [
"MIT"
] | 1 | 2021-05-24T00:17:46.000Z | 2021-05-24T00:17:46.000Z | holobot/extensions/weather/models/condition_data.py | rexor12/holobot | 89b7b416403d13ccfeee117ef942426b08d3651d | [
"MIT"
] | 41 | 2021-03-24T22:50:09.000Z | 2021-12-17T12:15:13.000Z | holobot/extensions/weather/models/condition_data.py | rexor12/holobot | 89b7b416403d13ccfeee117ef942426b08d3651d | [
"MIT"
] | null | null | null | from typing import Any, Dict
| 23.923077 | 59 | 0.580922 | from typing import Any, Dict
class ConditionData:
def __init__(self) -> None:
self.id = 0
self.icon = ""
self.condition_image_url = ""
@property
def id(self) -> int:
return self.__id
@id.setter
def id(self, value: int) -> None:
self.__id = value
@p... | 519 | 362 | 23 |
5c8215a52877a5bf096ae2ada1c1484be3b385af | 1,250 | py | Python | pyvizio/api/remote.py | jezzab/pyvizio | 8086f9e5aac49d1d99ade02684ca35c05e03a7eb | [
"MIT"
] | 72 | 2017-08-08T19:32:12.000Z | 2022-03-18T03:18:41.000Z | pyvizio/api/remote.py | raman325/pyvizio | 9cf45fcc9b409caf223a38d8f79c775742ab4127 | [
"MIT"
] | 48 | 2017-09-16T16:37:54.000Z | 2022-01-23T20:43:42.000Z | pyvizio/api/remote.py | ConnectionMaster/pyvizio | 0fe4558557917509d3da3bb24f9221f15ba901ce | [
"MIT"
] | 42 | 2017-09-04T22:59:21.000Z | 2022-03-18T03:18:30.000Z | """Vizio SmartCast API command and class for emulating remote key presses."""
from typing import List, Tuple
from pyvizio.api._protocol import ENDPOINT, KEY_ACTION
from pyvizio.api.base import CommandBase
class KeyPressEvent(object):
"""Emulated remote key press."""
def __init__(
self, key_code: Tu... | 32.051282 | 86 | 0.6712 | """Vizio SmartCast API command and class for emulating remote key presses."""
from typing import List, Tuple
from pyvizio.api._protocol import ENDPOINT, KEY_ACTION
from pyvizio.api.base import CommandBase
class KeyPressEvent(object):
"""Emulated remote key press."""
def __init__(
self, key_code: Tu... | 137 | 0 | 54 |
e8da176d7fb44c2420cac01d36817e010aac33bb | 19,689 | py | Python | Interface/Windows/DiceRollerWindow.py | Snackhole/SerpentRPG | 9e5ae019893592a46dd7681daba56af8e8e29744 | [
"MIT"
] | 1 | 2021-02-27T16:33:53.000Z | 2021-02-27T16:33:53.000Z | Interface/Windows/DiceRollerWindow.py | Snackhole/SerpentRPG | 9e5ae019893592a46dd7681daba56af8e8e29744 | [
"MIT"
] | null | null | null | Interface/Windows/DiceRollerWindow.py | Snackhole/SerpentRPG | 9e5ae019893592a46dd7681daba56af8e8e29744 | [
"MIT"
] | null | null | null | from SaveAndLoad.JSONSerializer import JSONSerializer
import os
from PyQt5 import QtCore
from PyQt5.QtWidgets import QSizePolicy, QGridLayout, QFrame, QLabel, QPushButton, QTextEdit, QSpinBox, QMessageBox, QAction, QInputDialog
from Core.DiceRoller import DiceRollerWithPresetRolls
from Interface.Dialogs.AddPresetRoll... | 46.436321 | 205 | 0.712428 | from SaveAndLoad.JSONSerializer import JSONSerializer
import os
from PyQt5 import QtCore
from PyQt5.QtWidgets import QSizePolicy, QGridLayout, QFrame, QLabel, QPushButton, QTextEdit, QSpinBox, QMessageBox, QAction, QInputDialog
from Core.DiceRoller import DiceRollerWithPresetRolls
from Interface.Dialogs.AddPresetRoll... | 18,218 | 28 | 696 |
baf6017ed1da47d5e192edc45a88b8f260f3a0ae | 1,269 | py | Python | logd_predictor.py | PatWalters/sfi | 01b5f6d80f30ecd3fda4c34f9502f01932103e34 | [
"MIT"
] | 7 | 2021-10-06T00:36:54.000Z | 2022-02-09T17:51:09.000Z | logd_predictor.py | PatWalters/sfi | 01b5f6d80f30ecd3fda4c34f9502f01932103e34 | [
"MIT"
] | null | null | null | logd_predictor.py | PatWalters/sfi | 01b5f6d80f30ecd3fda4c34f9502f01932103e34 | [
"MIT"
] | 4 | 2021-10-06T00:38:44.000Z | 2022-03-28T07:54:04.000Z | #!/usr/bin/env python
import sys
import os
import lightgbm as lgbm
from rdkit import Chem
from rdkit.Chem import Descriptors
if __name__ == "__main__":
main()
| 27 | 89 | 0.621749 | #!/usr/bin/env python
import sys
import os
import lightgbm as lgbm
from rdkit import Chem
from rdkit.Chem import Descriptors
class LogDPredictor:
def __init__(self, model_file_name):
if not os.path.exists(model_file_name):
print(f"Error: Could not find model file {model_file_name}", file=sys.... | 976 | -1 | 126 |
03635a7a026a38875482b9eeeed9abd2cb7404a1 | 921 | py | Python | libsrc/mount_sd.py | t-ikegami/WioTerminal-CircuitPython | efbdc2e13ad969fe009d88f7ec4b836ca61ae973 | [
"MIT"
] | null | null | null | libsrc/mount_sd.py | t-ikegami/WioTerminal-CircuitPython | efbdc2e13ad969fe009d88f7ec4b836ca61ae973 | [
"MIT"
] | 1 | 2022-01-19T00:16:02.000Z | 2022-01-26T03:43:34.000Z | libsrc/mount_sd.py | t-ikegami/WioTerminal-CircuitPython | efbdc2e13ad969fe009d88f7ec4b836ca61ae973 | [
"MIT"
] | null | null | null | import board
import busio
import sdcardio
import storage
import digitalio
spi = None
sd = None
vfs = None
path = "/sd"
det = digitalio.DigitalInOut(board.SD_DET)
det.switch_to_input(pull = digitalio.Pull.UP) # det.value == False if sd card is inserted.
mount()
| 20.021739 | 90 | 0.659066 | import board
import busio
import sdcardio
import storage
import digitalio
spi = None
sd = None
vfs = None
path = "/sd"
det = digitalio.DigitalInOut(board.SD_DET)
det.switch_to_input(pull = digitalio.Pull.UP) # det.value == False if sd card is inserted.
def mount() :
global spi, sd, vfs
if det.value is True... | 586 | 0 | 69 |
b669c2aaabe55678a168ec101a8038d60511878a | 190 | py | Python | store/admin.py | JuanFariasGit/crm | 5ab322644cb988a916bf6b5e8ee79322a40f2601 | [
"MIT"
] | null | null | null | store/admin.py | JuanFariasGit/crm | 5ab322644cb988a916bf6b5e8ee79322a40f2601 | [
"MIT"
] | null | null | null | store/admin.py | JuanFariasGit/crm | 5ab322644cb988a916bf6b5e8ee79322a40f2601 | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import Store
admin.site.register(Store, StoreAdmin)
| 19 | 51 | 0.752632 | from django.contrib import admin
from .models import Store
class StoreAdmin(admin.ModelAdmin):
list_display = ['store', 'created', 'modified']
admin.site.register(Store, StoreAdmin)
| 0 | 66 | 23 |
cee5e0f1bb4fe4c6b094e3d9cca4e9ef89355979 | 1,471 | py | Python | pywps/inout/formats/lists.py | ricardogsilva/PyWPS | 9ce51df7d81f9cd4bca47c026ec335490e5995e6 | [
"MIT"
] | null | null | null | pywps/inout/formats/lists.py | ricardogsilva/PyWPS | 9ce51df7d81f9cd4bca47c026ec335490e5995e6 | [
"MIT"
] | null | null | null | pywps/inout/formats/lists.py | ricardogsilva/PyWPS | 9ce51df7d81f9cd4bca47c026ec335490e5995e6 | [
"MIT"
] | null | null | null | """List of supported formats
"""
from collections import namedtuple
_FORMAT = namedtuple('FormatDefinition', 'mime_type,'
'extension, schema')
_FORMATS = namedtuple('FORMATS', 'GEOJSON, JSON, SHP, GML, GEOTIFF, WCS,'
'WCS100, WCS110, WCS20, WFS, WFS100,'
... | 47.451613 | 73 | 0.598232 | """List of supported formats
"""
from collections import namedtuple
_FORMAT = namedtuple('FormatDefinition', 'mime_type,'
'extension, schema')
_FORMATS = namedtuple('FORMATS', 'GEOJSON, JSON, SHP, GML, GEOTIFF, WCS,'
'WCS100, WCS110, WCS20, WFS, WFS100,'
... | 0 | 0 | 0 |
22d8415dfd3f850520286bd77b038b8db02a97c1 | 898 | py | Python | src/bitcaster/dispatchers/handlers/system_email.py | bitcaster-io/bitcaster | 9f1bad96e00e3bc78a22451731e231d30662b166 | [
"BSD-3-Clause"
] | 4 | 2018-03-01T10:22:30.000Z | 2020-04-04T16:31:11.000Z | src/bitcaster/dispatchers/handlers/system_email.py | bitcaster-io/bitcaster | 9f1bad96e00e3bc78a22451731e231d30662b166 | [
"BSD-3-Clause"
] | 60 | 2018-05-20T04:42:32.000Z | 2022-02-10T17:03:37.000Z | src/bitcaster/dispatchers/handlers/system_email.py | bitcaster-io/bitcaster | 9f1bad96e00e3bc78a22451731e231d30662b166 | [
"BSD-3-Clause"
] | 1 | 2018-08-04T05:06:45.000Z | 2018-08-04T05:06:45.000Z | from logging import getLogger
from constance import config
from django.conf import settings
from ..base import DispatcherOptions
from ..registry import dispatcher_registry
from .email import Email
logger = getLogger(__name__)
@dispatcher_registry.register
| 26.411765 | 62 | 0.648107 | from logging import getLogger
from constance import config
from django.conf import settings
from ..base import DispatcherOptions
from ..registry import dispatcher_registry
from .email import Email
logger = getLogger(__name__)
class EmailOptions(DispatcherOptions):
pass
@dispatcher_registry.register
class Sys... | 401 | 190 | 45 |
28eb4d932c793f92c5b6135259ddd373c9a0a9ab | 27,092 | py | Python | Scripts/simulation/display_snippet_tuning.py | velocist/TS4CheatsInfo | b59ea7e5f4bd01d3b3bd7603843d525a9c179867 | [
"Apache-2.0"
] | null | null | null | Scripts/simulation/display_snippet_tuning.py | velocist/TS4CheatsInfo | b59ea7e5f4bd01d3b3bd7603843d525a9c179867 | [
"Apache-2.0"
] | null | null | null | Scripts/simulation/display_snippet_tuning.py | velocist/TS4CheatsInfo | b59ea7e5f4bd01d3b3bd7603843d525a9c179867 | [
"Apache-2.0"
] | null | null | null | # uncompyle6 version 3.7.4
# Python bytecode 3.7 (3394)
# Decompiled from: Python 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:58:18) [MSC v.1900 64 bit (AMD64)]
# Embedded file name: T:\InGame\Gameplay\Scripts\Server\display_snippet_tuning.py
# Compiled at: 2020-01-29 22:49:46
# Size of source mod 2**32: 20461 bytes... | 61.853881 | 601 | 0.574893 | # uncompyle6 version 3.7.4
# Python bytecode 3.7 (3394)
# Decompiled from: Python 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:58:18) [MSC v.1900 64 bit (AMD64)]
# Embedded file name: T:\InGame\Gameplay\Scripts\Server\display_snippet_tuning.py
# Compiled at: 2020-01-29 22:49:46
# Size of source mod 2**32: 20461 bytes... | 3,114 | 9,237 | 215 |
9cb6847c2290f59de2cb26d3787235a41e1a377f | 336 | py | Python | venv/lib/python2.7/dist-packages/landscape/sysinfo/landscapelink.py | pengwu/scapy_env | 3db9c5dea2e219048a2387649d6d89be342903d9 | [
"MIT"
] | null | null | null | venv/lib/python2.7/dist-packages/landscape/sysinfo/landscapelink.py | pengwu/scapy_env | 3db9c5dea2e219048a2387649d6d89be342903d9 | [
"MIT"
] | null | null | null | venv/lib/python2.7/dist-packages/landscape/sysinfo/landscapelink.py | pengwu/scapy_env | 3db9c5dea2e219048a2387649d6d89be342903d9 | [
"MIT"
] | null | null | null | from twisted.internet.defer import succeed
| 24 | 58 | 0.636905 | from twisted.internet.defer import succeed
class LandscapeLink(object):
def register(self, sysinfo):
self._sysinfo = sysinfo
def run(self):
self._sysinfo.add_footnote(
"Graph this data and manage this system at:\n"
" https://landscape.canonical.com/")
retur... | 208 | 7 | 77 |