hexsha stringlengths 40 40 | size int64 6 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 130 | 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 130 | 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 130 | 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.53 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 6 1.04M | filtered:remove_non_ascii int64 0 538k | filtered:remove_decorators int64 0 917k | filtered:remove_async int64 0 722k | filtered:remove_classes int64 -45 1M | filtered:remove_generators int64 0 814k | filtered:remove_function_no_docstring int64 -102 850k | filtered:remove_class_no_docstring int64 -3 5.46k | filtered:remove_unused_imports int64 -1,350 52.4k | filtered:remove_delete_markers int64 0 59.6k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
23f54cc870cf05d60c13ef1c334edaf8af01defa | 301 | py | Python | 40 Algorithm challenge/challenge 3.py | T0dCNg/All-In-One | f86d7f46d3a4fafde5c5d087cffe1e3414870c48 | [
"Unlicense"
] | 1 | 2022-01-27T16:28:51.000Z | 2022-01-27T16:28:51.000Z | 40 Algorithm challenge/challenge 3.py | T0dCNg/All-In-One | f86d7f46d3a4fafde5c5d087cffe1e3414870c48 | [
"Unlicense"
] | null | null | null | 40 Algorithm challenge/challenge 3.py | T0dCNg/All-In-One | f86d7f46d3a4fafde5c5d087cffe1e3414870c48 | [
"Unlicense"
] | null | null | null | #Challenge 3
#The program asks the user to inputtheir surname and then their first name.
#The program then outputsthe users first name and then their surname separately.
name2 = input("please enter your surname: ")
name1 = input("please enter your first name: ")
print(name2)
print(name1)
| 30.1 | 82 | 0.744186 | #Challenge 3
#The program asks the user to inputtheir surname and then their first name.
#The program then outputsthe user’s first name and then their surname separately.
name2 = input("please enter your surname: ")
name1 = input("please enter your first name: ")
print(name2)
print(name1)
| 3 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
0b2070746fa1ea5966242d1e72b2c334bf6327ef | 37,346 | py | Python | importers/instagram.py | audacious-software/Passive-Data-Kit-External-Data | 2cfa93f31f53dcce8bb38f99144d993dd1cd4a9b | [
"Apache-2.0"
] | 1 | 2021-07-07T21:13:53.000Z | 2021-07-07T21:13:53.000Z | importers/instagram.py | audacious-software/Passive-Data-Kit-External-Data | 2cfa93f31f53dcce8bb38f99144d993dd1cd4a9b | [
"Apache-2.0"
] | 8 | 2020-11-18T15:29:17.000Z | 2022-02-24T20:38:27.000Z | importers/instagram.py | audacious-software/Passive-Data-Kit-External-Data | 2cfa93f31f53dcce8bb38f99144d993dd1cd4a9b | [
"Apache-2.0"
] | null | null | null | # pylint: disable=line-too-long
from __future__ import print_function
# Older format?
| 51.582873 | 270 | 0.695041 | # pylint: disable=line-too-long
from __future__ import print_function
import json
import re
import traceback
import zipfile
import arrow
import pytz
from passive_data_kit.models import DataPoint
from passive_data_kit_external_data.models import annotate_field
from ..utils import hash_content, encrypt_content, cre... | 0 | 0 | 0 | 0 | 0 | 36,402 | 0 | 101 | 755 |
cbbfc63bb3d1bd594dcc6409654a03119267b06e | 563 | py | Python | setup.py | GambitResearch/use_logging | 6d941fbf4c452fb56a919e5975a373aaaf65123e | [
"MIT"
] | 1 | 2018-04-23T14:01:08.000Z | 2018-04-23T14:01:08.000Z | setup.py | GambitResearch/use_logging | 6d941fbf4c452fb56a919e5975a373aaaf65123e | [
"MIT"
] | 1 | 2020-11-14T03:37:39.000Z | 2020-11-14T03:37:39.000Z | setup.py | GambitResearch/use_logging | 6d941fbf4c452fb56a919e5975a373aaaf65123e | [
"MIT"
] | null | null | null | from distutils.core import setup
import os
from setuptools import find_packages
DIR = os.path.dirname(__file__)
with open(os.path.join(DIR, "README.md")) as f:
readme = f.read().splitlines()
setup(
name='use_logging',
version='0.0.1',
packages=find_packages(include='use_logging*'),
url='https://github.com/Gamb... | 23.458333 | 53 | 0.726465 | from distutils.core import setup
import os
from setuptools import find_packages
DIR = os.path.dirname(__file__)
with open(os.path.join(DIR, "README.md")) as f:
readme = f.read().splitlines()
setup(
name='use_logging',
version='0.0.1',
packages=find_packages(include='use_logging*'),
url='https://github.com/Gamb... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
880060e846ba0c4e439ab8b8472884c5df0da377 | 5,795 | py | Python | Bongard-LOGO_Baselines/models/classifier.py | simitii/Bongard-LOGO | 45a0ab244c809b32bcba139b7273b8ec5aa0708c | [
"MIT"
] | 5 | 2020-08-19T01:50:11.000Z | 2020-08-25T13:58:23.000Z | Bongard-LOGO_Baselines/models/classifier.py | simitii/Bongard-LOGO | 45a0ab244c809b32bcba139b7273b8ec5aa0708c | [
"MIT"
] | null | null | null | Bongard-LOGO_Baselines/models/classifier.py | simitii/Bongard-LOGO | 45a0ab244c809b32bcba139b7273b8ec5aa0708c | [
"MIT"
] | null | null | null | import torch.nn as nn
| 30.824468 | 104 | 0.603451 | import math
import torch
import torch.nn as nn
import models
import utils
from .models import register
@register('classifier')
class Classifier(nn.Module):
def __init__(self, encoder, encoder_args,
classifier, classifier_args):
super().__init__()
self.encoder = models.make(... | 0 | 5,593 | 0 | 0 | 0 | 0 | 0 | -29 | 204 |
86930328405a67946a08f93b1eefb3fea203cf53 | 2,328 | py | Python | bigtop-packages/src/charm/hive/layer-hive/tests/02-smoke-test.py | sekikn2/bigtop | f183d9430b7c8c98d475a379d6980b16bcbb6c0b | [
"Apache-2.0"
] | 371 | 2015-01-19T05:42:51.000Z | 2022-03-27T14:46:52.000Z | bigtop-packages/src/charm/hive/layer-hive/tests/02-smoke-test.py | sekikn2/bigtop | f183d9430b7c8c98d475a379d6980b16bcbb6c0b | [
"Apache-2.0"
] | 491 | 2015-03-10T17:25:02.000Z | 2022-03-30T12:22:44.000Z | bigtop-packages/src/charm/hive/layer-hive/tests/02-smoke-test.py | sekikn2/bigtop | f183d9430b7c8c98d475a379d6980b16bcbb6c0b | [
"Apache-2.0"
] | 395 | 2015-01-02T20:53:01.000Z | 2022-03-21T08:49:08.000Z | #!/usr/bin/env python3
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "Lic... | 38.163934 | 81 | 0.672251 | #!/usr/bin/env python3
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "Lic... | 0 | 905 | 0 | 504 | 0 | 0 | 0 | -20 | 68 |
2c283e5675178b2b85b5f4e137d34e9bb198f24c | 1,512 | py | Python | speed_friending_matcher/core/person.py | machinekoder/speed-friending-matcher | c1d63c44e198497662c561342b64f597cb8623e9 | [
"MIT"
] | 4 | 2018-05-04T15:44:09.000Z | 2019-03-17T04:54:20.000Z | speed_friending_matcher/core/person.py | machinekoder/speed-friending-and-dating-matcher | c1d63c44e198497662c561342b64f597cb8623e9 | [
"MIT"
] | 12 | 2017-10-21T10:42:28.000Z | 2019-02-27T10:33:04.000Z | speed_friending_matcher/core/person.py | machinekoder/speed-friending-matcher | c1d63c44e198497662c561342b64f597cb8623e9 | [
"MIT"
] | 8 | 2018-01-02T10:14:19.000Z | 2022-01-11T03:17:04.000Z | # -*- coding: utf-8 -*-
| 20.432432 | 70 | 0.578042 | # -*- coding: utf-8 -*-
from aenum import Flag
from .results import Results
class MatchingFlags(Flag):
no_flags = 0
match_all = 1
class Person(object):
def __init__(
self,
name,
number,
marked_numbers,
flags=MatchingFlags.no_flags,
email=None,
phon... | 0 | 314 | 0 | 1,074 | 0 | 0 | 0 | 8 | 90 |
a6d758ca7000afd5d7e09cef42c9adc4d7d8629e | 347 | py | Python | tests/python/test_nltk.py | lcnja/modulefiles-1 | 2bbaf48089ef55f0a8247e6c365103f2b852feec | [
"Apache-2.0"
] | 6 | 2016-03-17T13:59:43.000Z | 2021-07-08T06:15:33.000Z | tests/python/test_nltk.py | lcnja/modulefiles-1 | 2bbaf48089ef55f0a8247e6c365103f2b852feec | [
"Apache-2.0"
] | null | null | null | tests/python/test_nltk.py | lcnja/modulefiles-1 | 2bbaf48089ef55f0a8247e6c365103f2b852feec | [
"Apache-2.0"
] | 2 | 2016-08-10T16:04:15.000Z | 2016-10-13T17:38:24.000Z | import nltk
import sys
sentence = """At eight o'clock on Thursday morning Arthur didn't feel very good."""
tokens = nltk.word_tokenize(sentence)
if tokens != ['At', 'eight', "o'clock", 'on', 'Thursday', 'morning',
'Arthur', 'did', "n't", 'feel', 'very', 'good', '.']:
sys.stderr.write("Error in token... | 31.545455 | 83 | 0.613833 | import nltk
import sys
sentence = """At eight o'clock on Thursday morning Arthur didn't feel very good."""
tokens = nltk.word_tokenize(sentence)
if tokens != ['At', 'eight', "o'clock", 'on', 'Thursday', 'morning',
'Arthur', 'did', "n't", 'feel', 'very', 'good', '.']:
sys.stderr.write("Error in token... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
82a5222a023194785deed9788f9a013c3fa11c0a | 84 | py | Python | vyperlogix/products/data.py | raychorn/chrome_gui | f1fade70b61af12ee43c55c075aa9cfd32caa962 | [
"CC0-1.0"
] | 1 | 2020-09-29T01:36:33.000Z | 2020-09-29T01:36:33.000Z | vyperlogix/products/data.py | raychorn/chrome_gui | f1fade70b61af12ee43c55c075aa9cfd32caa962 | [
"CC0-1.0"
] | null | null | null | vyperlogix/products/data.py | raychorn/chrome_gui | f1fade70b61af12ee43c55c075aa9cfd32caa962 | [
"CC0-1.0"
] | null | null | null | import os
_data_path_prefix = lambda name:os.sep.join(['www.VyperLogix.com',name])
| 21 | 72 | 0.761905 | import os
_data_path_prefix = lambda name:os.sep.join(['www.VyperLogix.com',name])
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
fb5560a1846af690e1d1431d238f8f3bb488cacc | 1,139 | py | Python | setup.py | ideonate/sammy | 8a8b9fae28899429c1ad1e51e4ff5d6f7f6047ec | [
"Apache-2.0"
] | null | null | null | setup.py | ideonate/sammy | 8a8b9fae28899429c1ad1e51e4ff5d6f7f6047ec | [
"Apache-2.0"
] | null | null | null | setup.py | ideonate/sammy | 8a8b9fae28899429c1ad1e51e4ff5d6f7f6047ec | [
"Apache-2.0"
] | null | null | null | import pathlib
import pkg_resources
from setuptools import setup, find_packages
with pathlib.Path('requirements.txt').open() as requirements_txt:
install_requires = [
str(requirement)
for requirement
in pkg_resources.parse_requirements(requirements_txt)
]
version = '0.4.2'
setup(
n... | 31.638889 | 76 | 0.67691 | import pathlib
import pkg_resources
from setuptools import setup, find_packages
with pathlib.Path('requirements.txt').open() as requirements_txt:
install_requires = [
str(requirement)
for requirement
in pkg_resources.parse_requirements(requirements_txt)
]
version = '0.4.2'
setup(
n... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
41f3cc563c60d973d5785841494c8b5887325556 | 1,241 | py | Python | iii_reproducibility/mlflow_tracking_example.py | production-ml-book-team/prod-ml-book | b6886f5f2a79ddac9accf6b056041deb08e47217 | [
"MIT"
] | null | null | null | iii_reproducibility/mlflow_tracking_example.py | production-ml-book-team/prod-ml-book | b6886f5f2a79ddac9accf6b056041deb08e47217 | [
"MIT"
] | null | null | null | iii_reproducibility/mlflow_tracking_example.py | production-ml-book-team/prod-ml-book | b6886f5f2a79ddac9accf6b056041deb08e47217 | [
"MIT"
] | 1 | 2020-03-01T06:04:02.000Z | 2020-03-01T06:04:02.000Z | import sklearn.naive_bayes
import sklearn.feature_extraction.text
# New additions
import mlflow.sklearn
mlflow.set_tracking_uri("http://atrium.datmo.com")
mlflow.set_experiment("training_module")
...
train_and_evaluate_model() | 33.540541 | 91 | 0.691378 | import numpy
import sklearn.naive_bayes
import sklearn.feature_extraction.text
import sklearn.pipeline
# New additions
import mlflow.sklearn
mlflow.set_tracking_uri("http://atrium.datmo.com")
mlflow.set_experiment("training_module")
...
def train_and_evaluate_model():
with mlflow.start_run():
# Load data... | 0 | 0 | 0 | 0 | 0 | 952 | 0 | -7 | 67 |
a669c97df041bcfe9de6ff7b4f23af94ace2cc3f | 811 | py | Python | dice_spider_2/spider/test_mysql_connector.py | guanxin0206/dice_crawler | 0b929b49911dc92d718905b2e1112c91e15ef2cd | [
"BSD-2-Clause"
] | 1 | 2017-04-05T23:34:06.000Z | 2017-04-05T23:34:06.000Z | dice_spider_2/spider/test_mysql_connector.py | guanxin0206/dice_crawler | 0b929b49911dc92d718905b2e1112c91e15ef2cd | [
"BSD-2-Clause"
] | null | null | null | dice_spider_2/spider/test_mysql_connector.py | guanxin0206/dice_crawler | 0b929b49911dc92d718905b2e1112c91e15ef2cd | [
"BSD-2-Clause"
] | null | null | null | '''
Created on Jun 14, 2017
@author: xinguan
'''
# import mysql.connector
import mysql.connector
create_dice_jobs = (
"CREATE TABLE IF NOT EXISTS `dice_jobs` ("
" `job_unique_id` varchar(50) NOT NULL,"
" `job_title` text NOT NULL,"
" `job_url` text NOT NULL,"
" `company` text NOT NULL,"
" ... | 24.575758 | 63 | 0.604192 | '''
Created on Jun 14, 2017
@author: xinguan
'''
# import mysql.connector
import mysql.connector
create_dice_jobs = (
"CREATE TABLE IF NOT EXISTS `dice_jobs` ("
" `job_unique_id` varchar(50) NOT NULL,"
" `job_title` text NOT NULL,"
" `job_url` text NOT NULL,"
" `company` text NOT NULL,"
" ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
36c3ae068b1b22355b24edc20d0a52286b45a4ff | 1,922 | py | Python | src/utils.py | showmethecoin/upbit-trader | f29f0e6074c4cc2296ca098f7d53cac5dd780881 | [
"Apache-2.0"
] | 8 | 2021-04-30T08:30:21.000Z | 2022-03-08T13:35:36.000Z | src/utils.py | showmethecoin/upbit-trader | f29f0e6074c4cc2296ca098f7d53cac5dd780881 | [
"Apache-2.0"
] | 4 | 2021-04-30T09:39:35.000Z | 2021-05-08T15:24:08.000Z | src/utils.py | showmethecoin/upbit-trader | f29f0e6074c4cc2296ca098f7d53cac5dd780881 | [
"Apache-2.0"
] | 4 | 2021-11-24T06:53:40.000Z | 2022-03-21T04:20:31.000Z | # !/usr/bin/python
# -*- coding: utf-8 -*-
import sys
import logging
def get_logger(print_format: str = '[%(asctime)s.%(msecs)03d: %(levelname).1s %(filename)s:%(lineno)s] %(message)s',
date_format: str = '%Y-%m-%d %H:%M:%S',
print: bool = True,
save: bool = True,
... | 34.945455 | 116 | 0.664412 | # !/usr/bin/python
# -*- coding: utf-8 -*-
import os
import sys
import logging
import asyncio as aio
from multiprocessing import set_start_method
def get_logger(print_format: str = '[%(asctime)s.%(msecs)03d: %(levelname).1s %(filename)s:%(lineno)s] %(message)s',
date_format: str = '%Y-%m-%d %H:%M:%S',
... | 54 | 0 | 0 | 0 | 0 | 665 | 0 | 12 | 135 |
4632d1de447aed60d67507867bf7386bdd3879cb | 1,001 | py | Python | multivitamin/applications/utils.py | keishinkickback/multivitamin | edc49267fc5a25182da0e7c7c8bba398225437e5 | [
"Apache-2.0"
] | 8 | 2019-05-08T20:27:41.000Z | 2021-04-19T15:17:22.000Z | multivitamin/applications/utils.py | keishinkickback/multivitamin | edc49267fc5a25182da0e7c7c8bba398225437e5 | [
"Apache-2.0"
] | 9 | 2019-05-17T19:16:50.000Z | 2022-03-11T23:46:55.000Z | multivitamin/applications/utils.py | keishinkickback/multivitamin | edc49267fc5a25182da0e7c7c8bba398225437e5 | [
"Apache-2.0"
] | 4 | 2019-05-07T18:00:51.000Z | 2019-06-22T02:35:51.000Z | import os
def load_idmap(idmap_file):
"""Load tab-separated idmap file containing label index and label string
Args:
idmap_file (str): filepath to idmap
Returns:
dict: labelmap (key=index, value=string)
"""
if not os.path.exists(idmap_file):
raise FileExistsError(idmap_fi... | 26.342105 | 76 | 0.625375 | import os
def load_idmap(idmap_file):
"""Load tab-separated idmap file containing label index and label string
Args:
idmap_file (str): filepath to idmap
Returns:
dict: labelmap (key=index, value=string)
"""
if not os.path.exists(idmap_file):
raise FileExistsError(idmap_fi... | 0 | 0 | 0 | 0 | 0 | 468 | 0 | 0 | 23 |
942215801e0b0bade4c9c10887697c879a9d34b9 | 15,908 | py | Python | AccountPickup/tests/test_views.py | hhauer/myinfo | 210a2caeff570650462f8774385aa9223b3bc858 | [
"MIT"
] | 2 | 2015-08-04T21:17:09.000Z | 2019-11-16T23:41:56.000Z | AccountPickup/tests/test_views.py | hhauer/myinfo | 210a2caeff570650462f8774385aa9223b3bc858 | [
"MIT"
] | null | null | null | AccountPickup/tests/test_views.py | hhauer/myinfo | 210a2caeff570650462f8774385aa9223b3bc858 | [
"MIT"
] | 2 | 2020-11-03T15:45:04.000Z | 2021-08-30T11:29:44.000Z | __author__ = 'Justin McClure'
| 43.583562 | 109 | 0.651622 | __author__ = 'Justin McClure'
from django.test import TestCase, Client
from django.core.urlresolvers import reverse
from random import choice
from lib.api_calls import APIException
class AccountPickupViewsTestCase(TestCase):
fixtures = ['AccountPickup_views_test_data.json']
HOST = 'testserver'
INDEX = r... | 0 | 220 | 0 | 15,266 | 0 | 0 | 0 | 63 | 319 |
12233affe5ac6a1b618d714a3c6910e493a5a18b | 1,795 | py | Python | scrape.py | djsnipa1/python-shit | b14eddd1f6bbf90063829ab85ed4bde7adb54e55 | [
"MIT"
] | 3 | 2020-03-03T22:55:19.000Z | 2021-04-26T02:39:41.000Z | scrape.py | djsnipa1/python-shit | b14eddd1f6bbf90063829ab85ed4bde7adb54e55 | [
"MIT"
] | 2 | 2020-03-03T22:55:20.000Z | 2020-04-08T12:33:15.000Z | scrape.py | djsnipa1/python-shit | b14eddd1f6bbf90063829ab85ed4bde7adb54e55 | [
"MIT"
] | null | null | null | import requests
import lxml.html
import json
# tutorial from An Intro to Web Scraping With lxml and Python Python Tips
# https://pythontips.com/2018/06/20/an-intro-to-web-scraping-with-lxml-and-python/
# html = requests.get("https://www.beatport.com/genre/psy-trance/13/top-100")
html = requests.get("https://store.st... | 29.42623 | 82 | 0.693036 | import requests
import lxml.html
import json
# tutorial from An Intro to Web Scraping With lxml and Python – Python Tips
# https://pythontips.com/2018/06/20/an-intro-to-web-scraping-with-lxml-and-python/
# html = requests.get("https://www.beatport.com/genre/psy-trance/13/top-100")
html = requests.get("https://store.s... | 3 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
8a70fe6634e3d7a0bb08218dc91468337036413b | 92 | py | Python | aenet/__init__.py | simaki/adaptive-enet | ecae8ad770b818c0ff51203e5a462e4dbf41beca | [
"BSD-3-Clause"
] | null | null | null | aenet/__init__.py | simaki/adaptive-enet | ecae8ad770b818c0ff51203e5a462e4dbf41beca | [
"BSD-3-Clause"
] | 12 | 2021-01-27T01:43:40.000Z | 2021-02-03T06:14:43.000Z | aenet/__init__.py | simaki/adaptive-enet | ecae8ad770b818c0ff51203e5a462e4dbf41beca | [
"BSD-3-Clause"
] | 1 | 2021-12-26T23:18:34.000Z | 2021-12-26T23:18:34.000Z | # flake8: noqa
| 18.4 | 39 | 0.826087 | # flake8: noqa
from .aen import AdaptiveElasticNet
from .aencv import AdaptiveElasticNetCV
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 32 | 45 |
b4b4904010fb89d55f0da4c6c0ace8c62a596c76 | 680 | py | Python | examples/reply.py | Mihitoko/pycord | 137c1474eed5fb4273e542bd22ad76764a8712fc | [
"MIT"
] | null | null | null | examples/reply.py | Mihitoko/pycord | 137c1474eed5fb4273e542bd22ad76764a8712fc | [
"MIT"
] | null | null | null | examples/reply.py | Mihitoko/pycord | 137c1474eed5fb4273e542bd22ad76764a8712fc | [
"MIT"
] | 1 | 2022-02-20T09:10:40.000Z | 2022-02-20T09:10:40.000Z | # This example requires the `message_content` privileged intent for access to message content.
import discord
intents = discord.Intents.default()
intents.message_content = True
client = MyClient(intents=intents)
client.run("TOKEN")
| 27.2 | 94 | 0.670588 | # This example requires the `message_content` privileged intent for access to message content.
import discord
class MyClient(discord.Client):
async def on_ready(self):
print(f"Logged in as {self.user} (ID: {self.user.id})")
print("------")
async def on_message(self, message: discord.Message)... | 0 | 0 | 357 | 10 | 0 | 0 | 0 | 0 | 76 |
11bcae79dbe3d4ab0b00e4eb06f7e6d850ed2b07 | 1,486 | py | Python | targetmodel.py | BXuan694/universalAdversarialPerturbation | ebca90f76b5d45715c98a1ff0b6f11df753b51c6 | [
"BSD-2-Clause"
] | 38 | 2019-01-19T09:43:13.000Z | 2022-01-05T09:47:02.000Z | targetmodel.py | BXuan694/universalAdversarialPerturbation | ebca90f76b5d45715c98a1ff0b6f11df753b51c6 | [
"BSD-2-Clause"
] | 3 | 2020-02-24T05:56:35.000Z | 2022-01-07T12:08:33.000Z | targetmodel.py | BXuan694/universalAdversarialPerturbation | ebca90f76b5d45715c98a1ff0b6f11df753b51c6 | [
"BSD-2-Clause"
] | 10 | 2019-02-19T10:05:57.000Z | 2021-06-07T08:02:36.000Z | import torch.nn as nn
root='/home/wang/Dataset/Caltech256/'
#root='/media/this/02ff0572-4aa8-47c6-975d-16c3b8062013/Caltech256/'
| 29.137255 | 93 | 0.611036 | import torch.nn as nn
from PIL import Image
from torch.utils.data import Dataset
import numpy as np
from transform_file import cut
root='/home/wang/Dataset/Caltech256/'
#root='/media/this/02ff0572-4aa8-47c6-975d-16c3b8062013/Caltech256/'
def default_loader(path):
return Image.open(path).convert('RGB')
class MyD... | 0 | 0 | 0 | 1,130 | 0 | 47 | 0 | 21 | 157 |
0a58b4051a93fb17bcd48c758537da77b9670348 | 14,519 | py | Python | appcenter/models.py | danielamitay/appcenter-rest-python | 240f71ce290d54f79b4e0814e068da6986abb34f | [
"MIT"
] | 10 | 2019-10-28T13:33:46.000Z | 2021-11-26T15:16:04.000Z | appcenter/models.py | danielamitay/appcenter-rest-python | 240f71ce290d54f79b4e0814e068da6986abb34f | [
"MIT"
] | 12 | 2020-12-09T14:38:31.000Z | 2022-02-23T11:13:37.000Z | appcenter/models.py | danielamitay/appcenter-rest-python | 240f71ce290d54f79b4e0814e068da6986abb34f | [
"MIT"
] | 10 | 2020-06-30T16:13:07.000Z | 2022-01-24T17:01:14.000Z | """Data type models"""
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import datetime
from typing import Optional
def iso8601parse(date_string: Optional[str]) -> Optional[datetime.datetime]:
"""Parse an ISO8601 date string into a datetime.
:param date_string: The date string to pa... | 25.83452 | 99 | 0.693574 | """Data type models"""
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import datetime
import enum
from typing import Any, Dict, List, Optional
import deserialize
def iso8601parse(date_string: Optional[str]) -> Optional[datetime.datetime]:
"""Parse an ISO8601 date string into a datetim... | 0 | 8,295 | 0 | 4,669 | 0 | 0 | 0 | 4 | 873 |
e3f8e1d22bcafa358edf7f3c0244842cba8cf451 | 4,272 | py | Python | indexer/index_mapper.py | FadedCosine/POS-Guided-Neural-Text-Generation | 2b5c72d8f2e08cbf4fe0babc4a4f1db09b348505 | [
"Apache-2.0"
] | 2 | 2021-06-23T08:52:20.000Z | 2021-06-23T08:52:31.000Z | indexer/index_mapper.py | FadedCosine/POS-Guided-Neural-Text-Generation | 2b5c72d8f2e08cbf4fe0babc4a4f1db09b348505 | [
"Apache-2.0"
] | null | null | null | indexer/index_mapper.py | FadedCosine/POS-Guided-Neural-Text-Generation | 2b5c72d8f2e08cbf4fe0babc4a4f1db09b348505 | [
"Apache-2.0"
] | null | null | null |
if __name__ =='__main__':
parser = get_parser()
args = parser.parse_args()
imap = IMap(args.dir_path, args.base_name)
imap.learn_dic(args.count_names, args.check_names)
imap.convert_and_save(args.convert_names) | 32.610687 | 96 | 0.59574 | import os
import pandas as pd
import collections
import re
import pickle
from basic_util.files import *
import argparse
def count(fl, targets=['input_context'], checks=['input_keyword'], vocab_size=10000):
cnter = collections.Counter()
s = set()
for filename in fl:
cur_df = pd.read_pickle(filename... | 0 | 641 | 0 | 1,208 | 0 | 1,975 | 0 | -34 | 246 |
bf31b720b525652222135f120c0a379b010899a7 | 294 | py | Python | profiles/migrations/New folder/0041_delete_user.py | Rxavio/link | a0aa34b89a769cfaa20a92a04980e142e42eaa10 | [
"MIT"
] | null | null | null | profiles/migrations/New folder/0041_delete_user.py | Rxavio/link | a0aa34b89a769cfaa20a92a04980e142e42eaa10 | [
"MIT"
] | null | null | null | profiles/migrations/New folder/0041_delete_user.py | Rxavio/link | a0aa34b89a769cfaa20a92a04980e142e42eaa10 | [
"MIT"
] | null | null | null | # Generated by Django 3.0.3 on 2020-11-03 07:43
| 17.294118 | 48 | 0.602041 | # Generated by Django 3.0.3 on 2020-11-03 07:43
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('profiles', '0040_auto_20201103_0801'),
]
operations = [
migrations.DeleteModel(
name='User',
),
]
| 0 | 0 | 0 | 188 | 0 | 0 | 0 | 11 | 46 |
c8677981f8f86e197f62a450212ec26939d05188 | 8,453 | py | Python | solaredge_influx/__main__.py | c0deaddict/solaredge-influx | f258b77f66ad53f67f25b62f4db7c33a935b6a00 | [
"MIT"
] | null | null | null | solaredge_influx/__main__.py | c0deaddict/solaredge-influx | f258b77f66ad53f67f25b62f4db7c33a935b6a00 | [
"MIT"
] | null | null | null | solaredge_influx/__main__.py | c0deaddict/solaredge-influx | f258b77f66ad53f67f25b62f4db7c33a935b6a00 | [
"MIT"
] | null | null | null |
solaredge_api_url = "https://monitoringapi.solaredge.com"
required_version = dict(release="1.0.0")
if __name__ == "__main__":
main()
| 32.891051 | 87 | 0.651603 | import argparse
import requests
from os import getenv
import sys
from influxdb import InfluxDBClient
from datetime import datetime, timedelta
solaredge_api_url = "https://monitoringapi.solaredge.com"
required_version = dict(release="1.0.0")
def api_request(api_key, path, params=dict()):
params = dict(**params,... | 0 | 0 | 0 | 0 | 0 | 7,881 | 0 | 10 | 409 |
eda9d93837af8aac0adf4e04bd2e1c6bad1a9773 | 811 | py | Python | QualificationRound/python/r.py | NavneelSinghal/HCLHackIITK | 91ceb865d1ff7c1ff109fbbbcfda8005d3b9cf93 | [
"MIT"
] | null | null | null | QualificationRound/python/r.py | NavneelSinghal/HCLHackIITK | 91ceb865d1ff7c1ff109fbbbcfda8005d3b9cf93 | [
"MIT"
] | null | null | null | QualificationRound/python/r.py | NavneelSinghal/HCLHackIITK | 91ceb865d1ff7c1ff109fbbbcfda8005d3b9cf93 | [
"MIT"
] | null | null | null |
print(main())
| 27.965517 | 144 | 0.52651 | import urllib3
def main():
input1='https://mettl-arq.s3-ap-southeast-1.amazonaws.com/questions/iit-kanpur/cyber-security-hackathon/round1/problem1/defaulttestcase.txt'
try:
r = urllib3.PoolManager().request('GET', input1)
except:
return ({0:0}, 'the URL is incorrect')
# alternative 1:
... | 0 | 0 | 0 | 0 | 0 | 759 | 0 | -7 | 44 |
47dc8cafe5b06270c0674e3e4e16755e648fcdc1 | 1,140 | py | Python | lib/models/backbone/supernet.py | Kevoen/LightTrack | 0f4e0ffe7f4faaf39d637dcaa3a42e032b96f76c | [
"MIT"
] | 221 | 2021-04-16T11:23:55.000Z | 2022-03-30T03:52:44.000Z | lib/models/backbone/supernet.py | swan2015/LightTrack | e94368aa80e924f8720887aa8f4fc23db074d3e7 | [
"MIT"
] | 25 | 2021-04-16T11:37:20.000Z | 2021-12-25T17:29:21.000Z | lib/models/backbone/supernet.py | swan2015/LightTrack | e94368aa80e924f8720887aa8f4fc23db074d3e7 | [
"MIT"
] | 45 | 2021-04-30T07:10:15.000Z | 2022-03-16T08:15:40.000Z | from lib.models.backbone.models.hypernet import _gen_supernet
def build_supernet_DP(flops_maximum=600):
"""Backbone with Dynamic output position"""
set_seed()
model, sta_num, size_factor = _gen_supernet(
flops_minimum=0,
flops_maximum=flops_maximum,
DP=True,
num_classes=1... | 22.8 | 61 | 0.657895 | import numpy as np
import torch
from lib.models.backbone.models.hypernet import _gen_supernet
def set_seed():
seed = 42
torch.manual_seed(seed)
torch.cuda.manual_seed_all(seed)
np.random.seed(seed)
torch.backends.cudnn.deterministic = True
torch.backends.cudnn.benchmark = False
def build_sup... | 0 | 0 | 0 | 0 | 0 | 497 | 0 | -12 | 90 |
130f82519e4ae3275d304a709e3078a731173f91 | 1,377 | py | Python | ktane/solverutils/morse.py | thecnoNSMB/ktane-mission-solver | 237d969a8acd21533b5fb18cc5a47dd03ba1cc7d | [
"MIT"
] | 1 | 2022-01-04T03:47:34.000Z | 2022-01-04T03:47:34.000Z | ktane/solverutils/morse.py | thecnoNSMB/ktane-mission-solver | 237d969a8acd21533b5fb18cc5a47dd03ba1cc7d | [
"MIT"
] | 4 | 2021-04-13T07:03:37.000Z | 2021-12-15T11:34:05.000Z | ktane/solverutils/morse.py | thecnoNSMB/ktane-mission-solver | 237d969a8acd21533b5fb18cc5a47dd03ba1cc7d | [
"MIT"
] | null | null | null | "Utilities for asking for and processing Morse Code signals."
from typing import Final
from ktane import ask
__all__ = ["valid_morse", "decode", "ask_word"]
MORSE_ALPHABET: Final = {
"a": ".-",
"b": "-...",
"c": "-.-.",
"d": "-..",
"e": ".",
"f": "..-.",
"g": "--.",
"h": "....",
... | 20.552239 | 73 | 0.424837 | "Utilities for asking for and processing Morse Code signals."
from typing import Final
from ktane import ask
__all__ = ["valid_morse", "decode", "ask_word"]
MORSE_ALPHABET: Final = {
"a": ".-",
"b": "-...",
"c": "-.-.",
"d": "-..",
"e": ".",
"f": "..-.",
"g": "--.",
"h": "....",
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
62095d061138f576a9cac1b1bf00dee00d53a7c1 | 8,026 | py | Python | tests/acceptance/rfc1350_test.py | pedrudehuere/py3tftp | b43d993f73a9f9617f22f886a9d2d6b91884ed1c | [
"MIT"
] | 41 | 2016-02-28T08:01:30.000Z | 2022-03-12T14:53:34.000Z | tests/acceptance/rfc1350_test.py | pedrudehuere/otftp | b43d993f73a9f9617f22f886a9d2d6b91884ed1c | [
"MIT"
] | 15 | 2017-03-04T04:04:42.000Z | 2021-05-19T03:33:46.000Z | tests/acceptance/rfc1350_test.py | pedrudehuere/otftp | b43d993f73a9f9617f22f886a9d2d6b91884ed1c | [
"MIT"
] | 22 | 2017-03-29T07:50:09.000Z | 2021-12-24T22:02:27.000Z | import unittest
if __name__ == '__main__':
unittest.main()
| 31.849206 | 79 | 0.567157 | import hashlib
import socket
import unittest
from io import BytesIO
from os import remove as rm
from os.path import exists
from time import sleep
import tests.test_helpers as h
class TestRRQ(unittest.TestCase):
@classmethod
def setUpClass(cls):
with open('LICENSE', 'rb') as f:
cls.license... | 0 | 1,091 | 0 | 6,636 | 0 | 0 | 0 | 7 | 224 |
b5f117895fcef3c40425dd579c4ad9c9fc4abb1b | 1,561 | py | Python | rvo/cli.py | noqqe/rvo | 423e1ea1aea0a2dc849ceae838e18896a13e7771 | [
"MIT"
] | 14 | 2016-05-04T13:56:10.000Z | 2019-08-01T14:31:33.000Z | rvo/cli.py | noqqe/rvo | 423e1ea1aea0a2dc849ceae838e18896a13e7771 | [
"MIT"
] | 12 | 2016-08-01T12:42:53.000Z | 2022-02-16T09:37:47.000Z | rvo/cli.py | noqqe/rvo | 423e1ea1aea0a2dc849ceae838e18896a13e7771 | [
"MIT"
] | null | null | null | #!/usr/bin/env python2.7
import os
import rvo.utils as utils
command_folder = os.path.join(os.path.dirname(__file__), 'commands')
CONTEXT_SETTINGS = dict(help_option_names=['-h', '--help'])
# rvo command class
# base help message
if __name__ == '__main__':
cli()
| 24.777778 | 80 | 0.627162 | #!/usr/bin/env python2.7
import sys
import pymongo
import os
import click
import datetime
import rvo.utils as utils
from rvo import __version__
import rvo.config
command_folder = os.path.join(os.path.dirname(__file__), 'commands')
CONTEXT_SETTINGS = dict(help_option_names=['-h', '--help'])
# rvo command class
class ... | 0 | 495 | 0 | 648 | 0 | 0 | 0 | -31 | 177 |
3ff966cd61af5b1670e1b17560b12849204e6a21 | 2,423 | py | Python | python/config.py | NREL/dgen_globetrotter | afef63c75a0721e18d2c3748a73a6f5300d2054b | [
"BSD-3-Clause"
] | null | null | null | python/config.py | NREL/dgen_globetrotter | afef63c75a0721e18d2c3748a73a6f5300d2054b | [
"BSD-3-Clause"
] | null | null | null | python/config.py | NREL/dgen_globetrotter | afef63c75a0721e18d2c3748a73a6f5300d2054b | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
This module contains variables that can be changed, but are not exposed to non-expert users.
"""
import os
import multiprocessing
#==============================================================================
#==============================================================================
... | 49.44898 | 323 | 0.401156 | # -*- coding: utf-8 -*-
"""
This module contains variables that can be changed, but are not exposed to non-expert users.
"""
import os
import multiprocessing
#==============================================================================
#==============================================================================
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
1d7828e5aaee6bca7ce83a37cb7af43c58b1cbd9 | 4,240 | py | Python | tsdata/models.py | caktus/Traffic-Stops | 2c6eda9477f1770c5ad1208a1937c3e828fbfb28 | [
"MIT"
] | 1 | 2021-12-10T14:58:11.000Z | 2021-12-10T14:58:11.000Z | tsdata/models.py | caktus/Traffic-Stops | 2c6eda9477f1770c5ad1208a1937c3e828fbfb28 | [
"MIT"
] | 5 | 2020-08-12T15:20:31.000Z | 2021-06-10T13:43:02.000Z | tsdata/models.py | caktus/Traffic-Stops | 2c6eda9477f1770c5ad1208a1937c3e828fbfb28 | [
"MIT"
] | null | null | null | from django.conf import settings
STATE_CHOICES = ((settings.NC_KEY, "North Carolina"),)
STATUS_CHOICES = (
("running", "Running"),
("error", "Error"),
("finished", "Finished"),
)
GEOGRAPHY_CHOICES = (
("county", "County"),
("place", "Place"),
)
| 34.754098 | 92 | 0.700708 | from django.conf import settings
from django.core.validators import MaxValueValidator, MinValueValidator
from django.db import models
STATE_CHOICES = ((settings.NC_KEY, "North Carolina"),)
STATUS_CHOICES = (
("running", "Running"),
("error", "Error"),
("finished", "Finished"),
)
GEOGRAPHY_CHOICES = (
... | 0 | 262 | 0 | 3,489 | 0 | 0 | 0 | 57 | 159 |
08aa3d0ae0cea2ca611adaf32c844e2e0178cc1a | 12,695 | py | Python | pyrehol/__init__.py | fakeNetflix/uber-repo-pyrehol | 7c8b75e1780c7e85cb77748fbdf3cf6fa6c14294 | [
"MIT"
] | null | null | null | pyrehol/__init__.py | fakeNetflix/uber-repo-pyrehol | 7c8b75e1780c7e85cb77748fbdf3cf6fa6c14294 | [
"MIT"
] | null | null | null | pyrehol/__init__.py | fakeNetflix/uber-repo-pyrehol | 7c8b75e1780c7e85cb77748fbdf3cf6fa6c14294 | [
"MIT"
] | null | null | null | from __future__ import absolute_import
__name__ = 'pyrehol'
__author__ = 'James Brown <jbrown@uber.com>'
version_info = (0, 3)
__version__ = '.'.join(map(str, version_info))
INDENT_CHAR = ' '
PREDEFINED_SERVICES = frozenset([
'any', 'anystateless', 'all',
'AH', 'apcupsd', 'apcupsdnis', 'aptproxy', 'asterisk... | 35.460894 | 110 | 0.589681 | from __future__ import absolute_import
import cStringIO
import types
__name__ = 'pyrehol'
__author__ = 'James Brown <jbrown@uber.com>'
version_info = (0, 3)
__version__ = '.'.join(map(str, version_info))
INDENT_CHAR = ' '
PREDEFINED_SERVICES = frozenset([
'any', 'anystateless', 'all',
'AH', 'apcupsd', 'apc... | 0 | 1,061 | 0 | 9,698 | 0 | 314 | 0 | -14 | 413 |
6b990586083411f6986cff94ef38575c8d9185de | 691 | py | Python | Lib/site-packages/win32/test/test_win32print.py | edupyter/EDUPYTER38 | 396183cea72987506f1ef647c0272a2577c56218 | [
"bzip2-1.0.6"
] | 1 | 2022-02-25T13:46:54.000Z | 2022-02-25T13:46:54.000Z | Lib/site-packages/win32/test/test_win32print.py | edupyter/EDUPYTER38 | 396183cea72987506f1ef647c0272a2577c56218 | [
"bzip2-1.0.6"
] | null | null | null | Lib/site-packages/win32/test/test_win32print.py | edupyter/EDUPYTER38 | 396183cea72987506f1ef647c0272a2577c56218 | [
"bzip2-1.0.6"
] | 1 | 2022-02-25T13:47:47.000Z | 2022-02-25T13:47:47.000Z | # Tests (scarce) for win32print module
import unittest
if __name__ == "__main__":
unittest.main()
| 26.576923 | 81 | 0.677279 | # Tests (scarce) for win32print module
import os
import unittest
import win32print as wprn
class Win32PrintTestCase(unittest.TestCase):
def setUp(self):
self.printer_idx = 0
self.printer_levels_all = list(range(1, 10))
self.local_printers = wprn.EnumPrinters(wprn.PRINTER_ENUM_LOCAL, None... | 0 | 0 | 0 | 525 | 0 | 0 | 0 | -8 | 69 |
1a6e55efc63a6e46a26098f90cb96d56d38f48aa | 7,070 | py | Python | modelvshuman/datasets/create_dataset.py | TizianThieringer/model-vs-human | 17729b8167520f682d93d55c340c27de07bb2681 | [
"Apache-2.0",
"CC-BY-4.0",
"MIT"
] | 158 | 2021-06-04T15:19:58.000Z | 2022-03-30T00:31:28.000Z | modelvshuman/datasets/create_dataset.py | TizianThieringer/model-vs-human | 17729b8167520f682d93d55c340c27de07bb2681 | [
"Apache-2.0",
"CC-BY-4.0",
"MIT"
] | 7 | 2021-07-20T03:57:34.000Z | 2022-02-01T11:00:47.000Z | modelvshuman/datasets/create_dataset.py | TizianThieringer/model-vs-human | 17729b8167520f682d93d55c340c27de07bb2681 | [
"Apache-2.0",
"CC-BY-4.0",
"MIT"
] | 14 | 2021-06-16T13:33:11.000Z | 2022-03-29T15:04:09.000Z | #!/usr/bin/env python3
"""
Create dataset and experiments.
A dataset is a directory with subdirectories, one subdir per class.
An experiment is a directory subdirectories, one subdir per participant.
"""
import os
from os.path import join as pjoin
from os import listdir as ld
import numpy as np
import shutil
import s... | 36.632124 | 121 | 0.599717 | #!/usr/bin/env python3
"""
Create dataset and experiments.
A dataset is a directory with subdirectories, one subdir per class.
An experiment is a directory subdirectories, one subdir per participant.
"""
import os
from os.path import join as pjoin
from os import listdir as ld
import numpy as np
import shutil
import s... | 0 | 0 | 0 | 0 | 0 | 3,615 | 0 | -10 | 68 |
989c61bb976af823ae52ec40394e5d1ec9e1e616 | 18,061 | py | Python | roxbot/cogs/voice.py | TBTerra/roxbot | 14ae7524201d6f795eefd33041c7a97b8868a521 | [
"MIT"
] | null | null | null | roxbot/cogs/voice.py | TBTerra/roxbot | 14ae7524201d6f795eefd33041c7a97b8868a521 | [
"MIT"
] | null | null | null | roxbot/cogs/voice.py | TBTerra/roxbot | 14ae7524201d6f795eefd33041c7a97b8868a521 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
MIT License
Copyright (c) 2017-2018 Roxanne Gibson
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... | 38.509595 | 173 | 0.71253 | # -*- coding: utf-8 -*-
"""
MIT License
Copyright (c) 2017-2018 Roxanne Gibson
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... | 0 | 11,682 | 910 | 2,725 | 0 | 518 | 0 | -5 | 270 |
4b499df6f92f959afcd92c59e28a63a941fc08bc | 729 | py | Python | ebr_trackerbot/command/untrack.py | tomtom-international/ebr-trackerbot | 327e43a1708aa01ef2022a3d786a72eab9274872 | [
"Apache-2.0"
] | null | null | null | ebr_trackerbot/command/untrack.py | tomtom-international/ebr-trackerbot | 327e43a1708aa01ef2022a3d786a72eab9274872 | [
"Apache-2.0"
] | 12 | 2019-08-02T12:31:47.000Z | 2019-08-16T11:45:42.000Z | ebr_trackerbot/command/untrack.py | LaudateCorpus1/ebr-trackerbot | 327e43a1708aa01ef2022a3d786a72eab9274872 | [
"Apache-2.0"
] | 1 | 2021-09-14T04:04:36.000Z | 2021-09-14T04:04:36.000Z | """
Slack Bot Untrack Command
"""
import logging
from ebr_trackerbot.bot import register_command, get_storage
def untrack_command(text, result, payload, config, commands):
"""
Slack Bot Untrack Command
"""
logging.debug("Untrack command")
test = result.group(1)
get_storage()["delete_for_user"... | 26.035714 | 113 | 0.672154 | """
Slack Bot Untrack Command
"""
import logging
from ebr_trackerbot.bot import register_command, get_storage
def untrack_command(text, result, payload, config, commands):
"""
Slack Bot Untrack Command
"""
logging.debug("Untrack command")
test = result.group(1)
get_storage()["delete_for_user"... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
a4744648f99aed2d6c2a7a6e702f3a4e944b14f0 | 7,651 | py | Python | RecoEgamma/EgammaMCTools/test/pfClusterForCalibration.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 852 | 2015-01-11T21:03:51.000Z | 2022-03-25T21:14:00.000Z | RecoEgamma/EgammaMCTools/test/pfClusterForCalibration.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 30,371 | 2015-01-02T00:14:40.000Z | 2022-03-31T23:26:05.000Z | RecoEgamma/EgammaMCTools/test/pfClusterForCalibration.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 3,240 | 2015-01-02T05:53:18.000Z | 2022-03-31T17:24:21.000Z | # EGM skimmer
# Author: Rafael Lopes de Sa
import FWCore.ParameterSet.Config as cms
# Run with the 2017 detector
from Configuration.Eras.Era_Run2_2017_cff import Run2_2017
process = cms.Process('SKIM',Run2_2017)
# Import the standard packages for reconstruction and digitization
process.load('Configuration.StandardSe... | 67.114035 | 191 | 0.66671 | # EGM skimmer
# Author: Rafael Lopes de Sa
import FWCore.ParameterSet.Config as cms
# Run with the 2017 detector
from Configuration.Eras.Era_Run2_2017_cff import Run2_2017
process = cms.Process('SKIM',Run2_2017)
# Import the standard packages for reconstruction and digitization
process.load('Configuration.StandardSe... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
e86d0fe71bb121a1115b9c3ad10fc4dbf87a3968 | 409 | py | Python | runesanalyzer/tests.py | clemsciences/runes-analyzer | 0af8baaf604179c31dcbf28b1a023ca650a9ff34 | [
"MIT"
] | 5 | 2018-10-17T15:35:51.000Z | 2022-01-23T10:57:55.000Z | runesanalyzer/tests.py | clemsciences/runes-analyzer | 0af8baaf604179c31dcbf28b1a023ca650a9ff34 | [
"MIT"
] | 5 | 2018-06-25T16:06:00.000Z | 2018-09-09T13:50:16.000Z | runesanalyzer/tests.py | clemsciences/runes-analyzer | 0af8baaf604179c31dcbf28b1a023ca650a9ff34 | [
"MIT"
] | null | null | null | """
"""
__author__ = ["Clment Besnier <clemsciences@aol.com>", ]
| 27.266667 | 119 | 0.513447 | """
"""
import unittest
from runesanalyzer import data
__author__ = ["Clément Besnier <clemsciences@aol.com>", ]
class Tests(unittest.TestCase):
def test_elder_futhark(self):
self.assertListEqual(['ᚠ', 'ᚢ', 'ᚦ', 'ᚨ', 'ᚱ', 'ᚲ', 'ᚷ', 'ᚹ', 'ᚺ', 'ᚾ', 'ᛁ', 'ᛃ', 'ᛇ', 'ᛈ', 'ᛉ', 'ᛊ', 'ᛏ', 'ᛒ',
... | 74 | 0 | 0 | 245 | 0 | 0 | 0 | 3 | 68 |
baf69027186fe85ed22eec3cf5fd7e5276dfca83 | 3,759 | py | Python | spec_uploader.py | uk-gov-mirror/nhsdigital.api-platform | 4e634b70268a3509b3f53ea2c87e41eeececfeda | [
"MIT"
] | null | null | null | spec_uploader.py | uk-gov-mirror/nhsdigital.api-platform | 4e634b70268a3509b3f53ea2c87e41eeececfeda | [
"MIT"
] | 56 | 2020-03-31T09:03:19.000Z | 2021-07-28T02:07:50.000Z | spec_uploader.py | uk-gov-mirror/nhsdigital.api-platform | 4e634b70268a3509b3f53ea2c87e41eeececfeda | [
"MIT"
] | 1 | 2021-04-11T07:33:15.000Z | 2021-04-11T07:33:15.000Z | """
spec_uploader.py
A tool for uploading apigee specs
Usage:
spec_uploader.py <apigee_org> <specs_dir> -u <username> -p <password> [-t <apigee_token>]
spec_uploader.py (-h | --help)
Options:
-h --help Show this screen
-u Which username to log in with
-p Password for login
-t Acc... | 32.973684 | 124 | 0.597233 | """
spec_uploader.py
A tool for uploading apigee specs
Usage:
spec_uploader.py <apigee_org> <specs_dir> -u <username> -p <password> [-t <apigee_token>]
spec_uploader.py (-h | --help)
Options:
-h --help Show this screen
-u Which username to log in with
-p Password for login
-t Acc... | 0 | 0 | 0 | 0 | 0 | 2,575 | 0 | -12 | 68 |
6ef6bb588ed00ad965b37321174f6dabafe870a9 | 1,001 | py | Python | target_to_lines.py | crazydigger/ru_summarization_mbart | 9da680bd67f869de9094c26f7a8a8e6b4c1b06bf | [
"Apache-2.0"
] | 1 | 2021-09-02T06:46:31.000Z | 2021-09-02T06:46:31.000Z | target_to_lines.py | AlexKay28/summarus | 9da680bd67f869de9094c26f7a8a8e6b4c1b06bf | [
"Apache-2.0"
] | null | null | null | target_to_lines.py | AlexKay28/summarus | 9da680bd67f869de9094c26f7a8a8e6b4c1b06bf | [
"Apache-2.0"
] | 1 | 2021-01-04T02:22:57.000Z | 2021-01-04T02:22:57.000Z | import argparse
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument('--archive-file', type=str, required=True)
parser.add_argument('--input-file', type=str, required=True)
parser.add_argument('--output-file', type=str, required=True)
args = parser.parse_args()
ta... | 35.75 | 76 | 0.705295 | import argparse
from allennlp.common.params import Params
from allennlp.data.dataset_readers.dataset_reader import DatasetReader
from allennlp.models.archival import load_archive
from summarus.readers import *
def target_to_lines(archive_file, input_file, output_file, lowercase=True):
archive = load_archive(arc... | 0 | 0 | 0 | 0 | 0 | 434 | 0 | 106 | 113 |
46d7bd2bfb36cc2efd9ae401ded0e3b065c81bac | 1,029 | py | Python | tempest/services/orchestration/json/dns_client.py | BeenzSyed/tempest | 7a64ee1216d844f6b99928b53f5c665b84cb8719 | [
"Apache-2.0"
] | null | null | null | tempest/services/orchestration/json/dns_client.py | BeenzSyed/tempest | 7a64ee1216d844f6b99928b53f5c665b84cb8719 | [
"Apache-2.0"
] | null | null | null | tempest/services/orchestration/json/dns_client.py | BeenzSyed/tempest | 7a64ee1216d844f6b99928b53f5c665b84cb8719 | [
"Apache-2.0"
] | null | null | null | __author__ = 'sabe6191'
| 33.193548 | 77 | 0.60447 | __author__ = 'sabe6191'
import json
import datetime
from tempest.common import rest_client
class DnsClient(rest_client.RestClient):
def __init__(self, config, username, password, auth_url,
token_url ,tenant_name=None):
super(DnsClient, self).__init__(config, username, password, auth_ur... | 0 | 0 | 0 | 675 | 0 | 215 | 0 | 1 | 114 |
983fe14532b3a5a93ae1262c586285af92006ebf | 505 | py | Python | list_remove_duplicate.py | xiaoledeng/python-tiny-functions | bf31421f4ea06b71c26fcc3de7b2134060ed34dc | [
"MIT"
] | 1 | 2019-09-19T15:09:14.000Z | 2019-09-19T15:09:14.000Z | list_remove_duplicate.py | xiaoledeng/python-tiny-functions | bf31421f4ea06b71c26fcc3de7b2134060ed34dc | [
"MIT"
] | null | null | null | list_remove_duplicate.py | xiaoledeng/python-tiny-functions | bf31421f4ea06b71c26fcc3de7b2134060ed34dc | [
"MIT"
] | null | null | null | #!/usr/local/bin/python3
# -*- coding: utf-8 -*-
"""
Date: 2019/11/27
Author: Xiao-Le Deng
Email: xiaoledeng at gmail.com
Function: remove duplicates in a given list
"""
# List1 = [1,1,1]
# List2 = ["John","John","John","Mark","David","David","Shalom","Shalom","Shalom"]
# print(list_remove_duplicate(List1))
# print... | 26.578947 | 82 | 0.706931 | #!/usr/local/bin/python3
# -*- coding: utf-8 -*-
"""
Date: 2019/11/27
Author: Xiao-Le Deng
Email: xiaoledeng at gmail.com
Function: remove duplicates in a given list
"""
def list_remove_duplicate(original_list):
format_list = list(set(original_list))
format_list.sort(key=original_list.index)
return forma... | 0 | 0 | 0 | 0 | 0 | 132 | 0 | 0 | 23 |
d1d3d70a9689a9253aab1fb4196730cfab689e31 | 618 | py | Python | neighbor/tests.py | olesigilai/neighborhood | d188323f45ea000320903cfc6b871abcf346e326 | [
"MIT",
"Unlicense"
] | null | null | null | neighbor/tests.py | olesigilai/neighborhood | d188323f45ea000320903cfc6b871abcf346e326 | [
"MIT",
"Unlicense"
] | null | null | null | neighbor/tests.py | olesigilai/neighborhood | d188323f45ea000320903cfc6b871abcf346e326 | [
"MIT",
"Unlicense"
] | null | null | null | # Create your tests here.
| 28.090909 | 63 | 0.726537 | from django.test import TestCase
from django.contrib.auth.models import User
from .models import healthservices,neighbourhood
import datetime as dt
# Create your tests here.
class neighbourhoodTestClass(TestCase):
def setUp(self):
self.kataret = neighbourhood(neighbourhood='kataret')
def test_instance... | 0 | 0 | 0 | 420 | 0 | 0 | 0 | 60 | 111 |
e09e9e063bc8a78a97ab704726d573106da2d907 | 1,223 | py | Python | setup.py | park-sungmoo/morfessor | b6356c877f4af28d90bda2373b3b71bd371a3273 | [
"BSD-2-Clause"
] | 2 | 2021-03-28T00:12:00.000Z | 2021-03-28T20:38:57.000Z | setup.py | park-sungmoo/morfessor | b6356c877f4af28d90bda2373b3b71bd371a3273 | [
"BSD-2-Clause"
] | null | null | null | setup.py | park-sungmoo/morfessor | b6356c877f4af28d90bda2373b3b71bd371a3273 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python
from codecs import open
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup
import re
main_py = open('morfessor/__init__.py', encoding='utf-8').read()
metadata = dict(re.findall("__([a-z]+)__ = '([^']+)'", main_py))
requires = [
# 'progressbar',
]
setup(na... | 28.44186 | 74 | 0.591169 | #!/usr/bin/env python
from codecs import open
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup
import re
main_py = open('morfessor/__init__.py', encoding='utf-8').read()
metadata = dict(re.findall("__([a-z]+)__ = '([^']+)'", main_py))
requires = [
# 'progressbar',
]
setup(na... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
5c07f3f58be4aba3c39cf1aebdf84f5e6d58c7f0 | 4,918 | py | Python | tests/docs_test.py | loganasherjones/yapconf | 0199d8b232fa50a590aac7dd5cc772efc1f7872c | [
"MIT"
] | 20 | 2018-01-30T14:32:40.000Z | 2020-08-04T21:31:37.000Z | tests/docs_test.py | loganasherjones/yapconf | 0199d8b232fa50a590aac7dd5cc772efc1f7872c | [
"MIT"
] | 95 | 2018-02-01T05:06:06.000Z | 2022-03-30T00:41:33.000Z | tests/docs_test.py | loganasherjones/yapconf | 0199d8b232fa50a590aac7dd5cc772efc1f7872c | [
"MIT"
] | 7 | 2018-02-06T21:15:24.000Z | 2021-11-04T16:39:20.000Z | # -*- coding: utf-8 -*-
# flake8: noqa
| 27.943182 | 104 | 0.530907 | # -*- coding: utf-8 -*-
from yapconf.docs import build_markdown_table
# flake8: noqa
def test_build_markdown_table():
headers = {'foo': 'Foo', 'bar': 'Bar'}
rows = [
{
'bar': 'bar_value',
'foo': 'x',
},
{
'bar': 'bar_value2',
'foo': 'y',... | 0 | 0 | 0 | 0 | 0 | 4,784 | 0 | 24 | 68 |
168c20682896b2ca672a403ebe967cd8636d6ded | 10,132 | py | Python | src/core_modules/config.py | dngfx/MagicBot | 56abfce2aac28f36e24ebe00229625196b269907 | [
"WTFPL"
] | 1 | 2020-12-31T03:10:42.000Z | 2020-12-31T03:10:42.000Z | src/core_modules/config.py | dngfx/MagicBot | 56abfce2aac28f36e24ebe00229625196b269907 | [
"WTFPL"
] | 3 | 2020-10-12T21:27:28.000Z | 2021-08-12T09:46:55.000Z | src/core_modules/config.py | dngfx/MagicBot | 56abfce2aac28f36e24ebe00229625196b269907 | [
"WTFPL"
] | 1 | 2020-10-12T21:17:58.000Z | 2020-10-12T21:17:58.000Z | # --depends-on channel_access
# --depends-on check_mode
# --depends-on commands
# --depends-on permissions
| 37.947566 | 85 | 0.554777 | # --depends-on channel_access
# --depends-on check_mode
# --depends-on commands
# --depends-on permissions
import enum
from src import ModuleManager, utils
class ConfigInvalidValue(Exception):
def __init__(self, message: str = None):
self.message = message
class ConfigSettingInexistent(Exception):
... | 0 | 5,869 | 0 | 3,961 | 0 | 0 | 0 | 5 | 184 |
41dbe518bd2b960e579c5e5fae4ea30bac2b30e3 | 6,597 | py | Python | src/pytest_mock_resources/patch/redshift/mock_s3_copy.py | schireson/pytest-mock-resources | a09fc18eeeac06c5589854ce200fa45f64c81cb5 | [
"MIT"
] | 49 | 2020-01-24T21:08:43.000Z | 2022-03-31T23:55:21.000Z | src/pytest_mock_resources/patch/redshift/mock_s3_copy.py | schireson/pytest-mock-resources | a09fc18eeeac06c5589854ce200fa45f64c81cb5 | [
"MIT"
] | 29 | 2020-03-11T19:07:50.000Z | 2022-03-30T16:49:06.000Z | src/pytest_mock_resources/patch/redshift/mock_s3_copy.py | schireson/pytest-mock-resources | a09fc18eeeac06c5589854ce200fa45f64c81cb5 | [
"MIT"
] | 10 | 2020-01-23T19:04:09.000Z | 2022-02-22T19:57:54.000Z | import binascii
from sqlalchemy import MetaData, Table
from pytest_mock_resources.compat import boto3
def _parse_s3_command(statement):
"""Format, Parse and call patched 'COPY' command."""
statement = strip(statement)
params = dict()
# deleting copy
tokens = statement.split()[1:]
# Fetchi... | 38.578947 | 100 | 0.609974 | import binascii
import csv
import gzip
import io
import sys
from sqlalchemy import MetaData, Table
from pytest_mock_resources.compat import boto3
def execute_mock_s3_copy_command(statement, engine):
params = _parse_s3_command(statement)
_mock_s3_copy(
table_name=params["table_name"],
schema... | 0 | 0 | 0 | 0 | 0 | 1,028 | 0 | -44 | 134 |
bd3b17572e5745406f81307baf82b51be3e01f17 | 682 | py | Python | src/iotools/__init__.py | chinarjoshi/polar-rover | b46ffc89352a0fb1520d86e00f5c24983fdbf79c | [
"MIT"
] | null | null | null | src/iotools/__init__.py | chinarjoshi/polar-rover | b46ffc89352a0fb1520d86e00f5c24983fdbf79c | [
"MIT"
] | null | null | null | src/iotools/__init__.py | chinarjoshi/polar-rover | b46ffc89352a0fb1520d86e00f5c24983fdbf79c | [
"MIT"
] | null | null | null | from flask_sqlalchemy import SQLAlchemy
from flask_login import LoginManager
from flask_bcrypt import Bcrypt
db = SQLAlchemy()
bcrypt = Bcrypt()
login_manager = LoginManager()
login_manager.login_view = 'sessions.login'
login_manager.login_message_category = 'info'
| 23.517241 | 48 | 0.777126 | from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from flask_login import LoginManager
from flask_bcrypt import Bcrypt
from iotools.config import Config
db = SQLAlchemy()
bcrypt = Bcrypt()
login_manager = LoginManager()
login_manager.login_view = 'sessions.login'
login_manager.login_message_category = '... | 0 | 0 | 0 | 0 | 0 | 332 | 0 | 14 | 67 |
05d44356b2346be5b170ee2ffa3cfc38f895d3ff | 3,433 | py | Python | setup.py | oarepo/cesnet-openid-remote | 4ca46fc94801e51267b7676e0c212a024e3af3a1 | [
"MIT"
] | null | null | null | setup.py | oarepo/cesnet-openid-remote | 4ca46fc94801e51267b7676e0c212a024e3af3a1 | [
"MIT"
] | 4 | 2021-02-19T10:53:28.000Z | 2021-04-09T17:15:56.000Z | setup.py | oarepo/cesnet-openid-remote | 4ca46fc94801e51267b7676e0c212a024e3af3a1 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright (C) 2021 CESNET.
#
# CESNET-OpenID-Remote is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see LICENSE file for more
# details.
"""CESNET OIDC Auth backend for OARepo"""
import os
from setuptools import find_packages, setup
readme... | 29.594828 | 77 | 0.630061 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2021 CESNET.
#
# CESNET-OpenID-Remote is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see LICENSE file for more
# details.
"""CESNET OIDC Auth backend for OARepo"""
import os
from setuptools import find_packages, setup
readme... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
0098e30c2ef9ea5e88b69f0c7ac211522ab302b6 | 476 | py | Python | src/pos/utils.py | ExplorerFreda/sub2-augmentation | 3f43e72a1b4eb5201472938ede8ea0fbe97be7c3 | [
"MIT"
] | 6 | 2021-07-14T22:49:32.000Z | 2021-08-22T14:32:17.000Z | src/pos/utils.py | ExplorerFreda/sub2-augmentation | 3f43e72a1b4eb5201472938ede8ea0fbe97be7c3 | [
"MIT"
] | null | null | null | src/pos/utils.py | ExplorerFreda/sub2-augmentation | 3f43e72a1b4eb5201472938ede8ea0fbe97be7c3 | [
"MIT"
] | 1 | 2021-07-15T03:19:39.000Z | 2021-07-15T03:19:39.000Z | high_resource_language_list = [
'bg', 'cs', 'da', 'de', 'en', 'es', 'eu', 'fa', 'fi', 'fr', 'he', 'hi',
'hr', 'id', 'it', 'nl', 'no', 'pl', 'pt', 'sl', 'sv'
]
low_resource_language_list = [
'el', 'et', 'ga', 'hu', 'ro', 'ta'
]
extra_language_list_ud12 = [
'ar', 'cu', 'fi_ftb', 'got', 'grc', 'grc_proie... | 31.733333 | 76 | 0.539916 | high_resource_language_list = [
'bg', 'cs', 'da', 'de', 'en', 'es', 'eu', 'fa', 'fi', 'fr', 'he', 'hi',
'hr', 'id', 'it', 'nl', 'no', 'pl', 'pt', 'sl', 'sv'
]
low_resource_language_list = [
'el', 'et', 'ga', 'hu', 'ro', 'ta'
]
extra_language_list_ud12 = [
'ar', 'cu', 'fi_ftb', 'got', 'grc', 'grc_proie... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
6a05f2d56018956a4ac6c006679c41bfd597e952 | 7,071 | py | Python | cirq/ion/ion_device.py | joshp112358/Cirq | c4fac27a9849e589ee05b4f702f2d7c9049aaeea | [
"Apache-2.0"
] | 15 | 2020-06-29T08:33:39.000Z | 2022-02-12T00:28:51.000Z | cirq/ion/ion_device.py | joshp112358/Cirq | c4fac27a9849e589ee05b4f702f2d7c9049aaeea | [
"Apache-2.0"
] | 4 | 2020-11-27T09:34:13.000Z | 2021-04-30T21:13:41.000Z | cirq/ion/ion_device.py | joshp112358/Cirq | c4fac27a9849e589ee05b4f702f2d7c9049aaeea | [
"Apache-2.0"
] | 11 | 2020-06-29T08:40:24.000Z | 2022-02-24T17:39:16.000Z | # Copyright 2018 The Cirq Developers
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | 39.949153 | 80 | 0.623391 | # Copyright 2018 The Cirq Developers
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | 0 | 5,862 | 0 | 0 | 0 | 365 | 0 | 88 | 117 |
4ab3bb9ddd1da5119cd9c519636fbb494ba987ad | 10,910 | py | Python | examples/tts/ljspeech/local/prepare_data.py | wgfi110/athena | e704884ec6a3a947769d892aa267578038e49ecb | [
"Apache-2.0"
] | 791 | 2019-12-22T03:09:04.000Z | 2022-03-26T01:57:42.000Z | examples/tts/ljspeech/local/prepare_data.py | wgfi110/athena | e704884ec6a3a947769d892aa267578038e49ecb | [
"Apache-2.0"
] | 198 | 2019-12-22T03:06:27.000Z | 2022-03-29T02:57:59.000Z | examples/tts/ljspeech/local/prepare_data.py | wgfi110/athena | e704884ec6a3a947769d892aa267578038e49ecb | [
"Apache-2.0"
] | 194 | 2019-12-24T03:59:29.000Z | 2022-03-25T02:44:51.000Z | #coding=utf-8
# Copyright (C) 2020 ATHENA AUTHORS; LanYu;
# 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 ... | 35.537459 | 153 | 0.628873 | #coding=utf-8
# Copyright (C) 2020 ATHENA AUTHORS; LanYu;
# 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 ... | 2 | 0 | 0 | 0 | 0 | 2,812 | 0 | 33 | 258 |
09b04334000e84dd407ae506dce11f9969eacf3d | 666 | py | Python | yossarian/book_groups/migrations/0003_auto_20151231_1605.py | avinassh/yossarian | b485da0669d87ad29f57ba2a4a446131aaf820a6 | [
"MIT"
] | null | null | null | yossarian/book_groups/migrations/0003_auto_20151231_1605.py | avinassh/yossarian | b485da0669d87ad29f57ba2a4a446131aaf820a6 | [
"MIT"
] | null | null | null | yossarian/book_groups/migrations/0003_auto_20151231_1605.py | avinassh/yossarian | b485da0669d87ad29f57ba2a4a446131aaf820a6 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2015-12-31 16:05
from __future__ import unicode_literals
| 25.615385 | 101 | 0.62012 | # -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2015-12-31 16:05
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('book_groups', '0002_progress'),
]
operations = [
... | 0 | 0 | 0 | 457 | 0 | 0 | 0 | 30 | 68 |
f3f8f0663273ae09a08d463054d3e72903562007 | 1,347 | py | Python | transactions/accounts/migrations/0001_initial.py | akash-dev-github/Transactions | 7f1b8897d914a1cf297aeff750c197d21ce98ca8 | [
"MIT"
] | null | null | null | transactions/accounts/migrations/0001_initial.py | akash-dev-github/Transactions | 7f1b8897d914a1cf297aeff750c197d21ce98ca8 | [
"MIT"
] | null | null | null | transactions/accounts/migrations/0001_initial.py | akash-dev-github/Transactions | 7f1b8897d914a1cf297aeff750c197d21ce98ca8 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.10.2 on 2016-10-09 19:24
from __future__ import unicode_literals
| 35.447368 | 130 | 0.614699 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.2 on 2016-10-09 19:24
from __future__ import unicode_literals
import datetime
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [... | 0 | 0 | 0 | 1,085 | 0 | 0 | 0 | 35 | 113 |
3d1c5ee77973eec7eef67ddca34a8343a0cf3724 | 6,691 | py | Python | custom_components/edgeos/clients/web_socket.py | kcleong/homeassistant-config | 15b7bc75f5d1055d8620ced87eed9d563475296d | [
"MIT"
] | null | null | null | custom_components/edgeos/clients/web_socket.py | kcleong/homeassistant-config | 15b7bc75f5d1055d8620ced87eed9d563475296d | [
"MIT"
] | null | null | null | custom_components/edgeos/clients/web_socket.py | kcleong/homeassistant-config | 15b7bc75f5d1055d8620ced87eed9d563475296d | [
"MIT"
] | null | null | null | """
This component provides support for Home Automation Manager (HAM).
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/edgeos/
"""
import logging
REQUIREMENTS = ["aiohttp"]
_LOGGER = logging.getLogger(__name__)
| 28.47234 | 87 | 0.606337 | """
This component provides support for Home Automation Manager (HAM).
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/edgeos/
"""
import asyncio
import json
import logging
import re
from typing import Optional
from urllib.parse import urlparse
import ai... | 0 | 636 | 2,329 | 3,157 | 0 | 0 | 0 | 66 | 224 |
9ca3fcb4f36e750dc158f22eee6d8701f2799cd8 | 1,918 | py | Python | venv/lib/python3.8/site-packages/azureml/_base_sdk_common/workspace/models/linked_service_props.py | amcclead7336/Enterprise_Data_Science_Final | ccdc0aa08d4726bf82d71c11a1cc0c63eb301a28 | [
"Unlicense",
"MIT"
] | null | null | null | venv/lib/python3.8/site-packages/azureml/_base_sdk_common/workspace/models/linked_service_props.py | amcclead7336/Enterprise_Data_Science_Final | ccdc0aa08d4726bf82d71c11a1cc0c63eb301a28 | [
"Unlicense",
"MIT"
] | null | null | null | venv/lib/python3.8/site-packages/azureml/_base_sdk_common/workspace/models/linked_service_props.py | amcclead7336/Enterprise_Data_Science_Final | ccdc0aa08d4726bf82d71c11a1cc0c63eb301a28 | [
"Unlicense",
"MIT"
] | 2 | 2021-05-23T16:46:31.000Z | 2021-05-26T23:51:09.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator 2.3.3... | 40.808511 | 107 | 0.637643 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator 2.3.3... | 0 | 0 | 0 | 1,358 | 0 | 0 | 0 | 17 | 50 |
626ab922c10d3f79f86d1f22251f5d6b2a46edfe | 963 | py | Python | notebooks/1.0-vg-runtime-simulation/timing.py | v715/py-U-Rerf | d1821ce95a3ccc3345faa673371f7a8e9a797f72 | [
"FTL"
] | 2 | 2018-09-18T00:06:46.000Z | 2018-09-18T12:59:38.000Z | notebooks/1.0-vg-runtime-simulation/timing.py | v715/py-U-Rerf | d1821ce95a3ccc3345faa673371f7a8e9a797f72 | [
"FTL"
] | 17 | 2018-09-17T23:50:25.000Z | 2018-10-12T19:30:21.000Z | notebooks/1.0-vg-runtime-simulation/timing.py | v715/py-U-Rerf | d1821ce95a3ccc3345faa673371f7a8e9a797f72 | [
"FTL"
] | null | null | null | #!/usr/bin/env python
# graph.py
# Created by Vivek Gopalakrishnan on 2018-11-13.
# Email: vgopala4@jhu.edu
# Copyright (c) 2018. All rights reserved.
import timeit
from src.features.summary import Stats
from src.random.bernoulli import RandomGraph
def measure_runtime(n, p, number=5):
"""
Calculates the ru... | 26.027027 | 79 | 0.686397 | #!/usr/bin/env python
# graph.py
# Created by Vivek Gopalakrishnan on 2018-11-13.
# Email: vgopala4@jhu.edu
# Copyright (c) 2018. All rights reserved.
import timeit
from src.features.summary import Stats
from src.random.bernoulli import RandomGraph
def measure_runtime(n, p, number=5):
"""
Calculates the ru... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
8d1f18ed4554971d39a164bbe0c71bd5477eddf5 | 1,360 | py | Python | NodeClassification/ADMM/ADMM/main_admm_auto_tune.py | x-zho14/Unified-LTH-GNN | edbb2f9aaa7cb363424dcfcb2ce198cfb66f3d55 | [
"MIT"
] | 29 | 2021-02-17T02:46:54.000Z | 2022-03-18T02:09:03.000Z | NodeClassification/ADMM/ADMM/main_admm_auto_tune.py | x-zho14/Unified-LTH-GNN | edbb2f9aaa7cb363424dcfcb2ce198cfb66f3d55 | [
"MIT"
] | 1 | 2021-09-03T13:30:50.000Z | 2021-09-03T13:30:50.000Z | NodeClassification/ADMM/ADMM/main_admm_auto_tune.py | x-zho14/Unified-LTH-GNN | edbb2f9aaa7cb363424dcfcb2ce198cfb66f3d55 | [
"MIT"
] | 10 | 2021-04-01T16:27:03.000Z | 2022-03-07T09:20:38.000Z | import os
learning_rate = [0.01, 0.001]
prune_ratio = 30
ADMM_times = [2,3,4,5,6,7]
Total_epochs = [10,30,40,50,60]
target_accuracy = 0.76
count = 0
highest_acc = 0
for i in range(len(learning_rate)):
for j in range(len(ADMM_times)):
for k in range(len(Total_epochs)):
lr = learning_rate[i]
... | 35.789474 | 83 | 0.491912 | import os
import numpy as np
learning_rate = [0.01, 0.001]
prune_ratio = 30
ADMM_times = [2,3,4,5,6,7]
Total_epochs = [10,30,40,50,60]
target_accuracy = 0.76
count = 0
highest_acc = 0
for i in range(len(learning_rate)):
for j in range(len(ADMM_times)):
for k in range(len(Total_epochs)):
lr = le... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -3 | 22 |
7dc23fe92ba79adcfc96da36352928d104bdba79 | 490 | py | Python | apps/users/admin.py | Mozilla-GitHub-Standards/93f18f14efcf5fdfc0e04f9bf247f66baf46663f37b1d2087ab8d850abc90803 | 4e374b4d52dfb9039ebe543e7f27682189022307 | [
"BSD-3-Clause"
] | 2 | 2015-04-06T15:20:29.000Z | 2016-12-30T12:25:11.000Z | apps/users/admin.py | Mozilla-GitHub-Standards/93f18f14efcf5fdfc0e04f9bf247f66baf46663f37b1d2087ab8d850abc90803 | 4e374b4d52dfb9039ebe543e7f27682189022307 | [
"BSD-3-Clause"
] | 2 | 2019-02-17T17:38:02.000Z | 2019-03-28T03:49:16.000Z | apps/users/admin.py | Mozilla-GitHub-Standards/93f18f14efcf5fdfc0e04f9bf247f66baf46663f37b1d2087ab8d850abc90803 | 4e374b4d52dfb9039ebe543e7f27682189022307 | [
"BSD-3-Clause"
] | 1 | 2019-03-28T03:49:18.000Z | 2019-03-28T03:49:18.000Z | from django.contrib import admin
from tower import ugettext_lazy as _
from users.models import Profile, Link
username = lambda u: u.user.username
username.short_description = _('Username')
admin.site.register(Profile, ProfileAdmin)
admin.site.register(Link, LinkAdmin)
| 21.304348 | 42 | 0.734694 | from django.contrib import admin
from tower import ugettext_lazy as _
from users.models import Profile, Link
username = lambda u: u.user.username
username.short_description = _('Username')
class ProfileAdmin(admin.ModelAdmin):
list_display = (username, 'name')
search_fields = ('name',)
class LinkAdmin(a... | 0 | 0 | 0 | 168 | 0 | 0 | 0 | 0 | 46 |
324d309f43981206af584f6bc12c55d7e3d30736 | 4,574 | py | Python | IMU/VTK-6.2.0/Filters/General/Testing/Python/TestMultiBlockStreamer.py | timkrentz/SunTracker | 9a189cc38f45e5fbc4e4c700d7295a871d022795 | [
"MIT"
] | 4 | 2016-03-30T14:31:52.000Z | 2019-02-02T05:01:32.000Z | IMU/VTK-6.2.0/Filters/General/Testing/Python/TestMultiBlockStreamer.py | timkrentz/SunTracker | 9a189cc38f45e5fbc4e4c700d7295a871d022795 | [
"MIT"
] | null | null | null | IMU/VTK-6.2.0/Filters/General/Testing/Python/TestMultiBlockStreamer.py | timkrentz/SunTracker | 9a189cc38f45e5fbc4e4c700d7295a871d022795 | [
"MIT"
] | 2 | 2019-08-30T23:36:13.000Z | 2019-11-08T16:52:01.000Z | #!/usr/bin/env python
import vtk
from vtk.util.misc import vtkGetDataRoot
VTK_DATA_ROOT = vtkGetDataRoot()
# we need to use composite data pipeline with multiblock datasets
alg = vtk.vtkAlgorithm()
pip = vtk.vtkCompositeDataPipeline()
alg.SetDefaultExecutivePrototype(pip)
#del pip
Ren1 = vtk.vtkRenderer()
... | 30.291391 | 78 | 0.776782 | #!/usr/bin/env python
import vtk
from vtk.test import Testing
from vtk.util.misc import vtkGetDataRoot
VTK_DATA_ROOT = vtkGetDataRoot()
# we need to use composite data pipeline with multiblock datasets
alg = vtk.vtkAlgorithm()
pip = vtk.vtkCompositeDataPipeline()
alg.SetDefaultExecutivePrototype(pip)
#del pi... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 7 | 23 |
716976b200135720854972a197428b45a78f6344 | 207 | py | Python | pdbuddy/formatters/simple.py | emou/pdbuddy | 5708c44803e46d06aca02a0402ebaec0c5ae4634 | [
"MIT"
] | null | null | null | pdbuddy/formatters/simple.py | emou/pdbuddy | 5708c44803e46d06aca02a0402ebaec0c5ae4634 | [
"MIT"
] | null | null | null | pdbuddy/formatters/simple.py | emou/pdbuddy | 5708c44803e46d06aca02a0402ebaec0c5ae4634 | [
"MIT"
] | null | null | null | from __future__ import absolute_import
| 20.7 | 49 | 0.772947 | from __future__ import absolute_import
from pdbuddy.formatters.base import BaseFormatter
class SimpleFormatter(BaseFormatter):
def __call__(self, frame, event, arg):
return str(frame.f_code)
| 0 | 0 | 0 | 93 | 0 | 0 | 0 | 28 | 46 |
26e8cceb26d881c4c50d1907d6a8246ef169ec29 | 786 | py | Python | Search_4_letter-webApp/vsearch4web.py | dlouima/python_project | 2f84c5131efccfa04a633a608605b957b20b5f7e | [
"Apache-2.0"
] | null | null | null | Search_4_letter-webApp/vsearch4web.py | dlouima/python_project | 2f84c5131efccfa04a633a608605b957b20b5f7e | [
"Apache-2.0"
] | null | null | null | Search_4_letter-webApp/vsearch4web.py | dlouima/python_project | 2f84c5131efccfa04a633a608605b957b20b5f7e | [
"Apache-2.0"
] | null | null | null | import vsearch as vsearch
from flask import Flask
app= Flask(__name__)
#
# @app.route('/')
# def hello() -> str:
# return redirect('/entry')
if __name__ == '__main__0':
app.run(debug=True)
| 22.457143 | 90 | 0.653944 | import vsearch as vsearch
from flask import Flask, render_template, request, redirect
app= Flask(__name__)
#
# @app.route('/')
# def hello() -> str:
# return redirect('/entry')
@app.route('/search4', methods=['POST'])
def do_search():
phrase = request.form['phrase']
letters= request.form['letters']
... | 0 | 501 | 0 | 0 | 0 | 0 | 0 | 36 | 46 |
a0f8dba11d5c9d23036254d6bc2c8e4009334ab5 | 580 | py | Python | src/tree/0669.trim-a-binary-search-tree/trim-a-binary-search-tree.py | lyphui/Just-Code | e0c3c3ecb67cb805080ff686e88522b2bffe7741 | [
"MIT"
] | 782 | 2019-11-19T08:20:49.000Z | 2022-03-25T06:59:09.000Z | src/0669.trim-a-binary-search-tree/trim-a-binary-search-tree.py | Heitao5200/Just-Code | 5bb3ee485a103418e693b7ec8e26dc84f3691c79 | [
"MIT"
] | 1 | 2021-03-04T12:21:01.000Z | 2021-03-05T01:23:54.000Z | src/0669.trim-a-binary-search-tree/trim-a-binary-search-tree.py | Heitao5200/Just-Code | 5bb3ee485a103418e693b7ec8e26dc84f3691c79 | [
"MIT"
] | 155 | 2019-11-20T08:20:42.000Z | 2022-03-19T07:28:09.000Z | # Definition for a binary tree node.
# class TreeNode:
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None | 27.619048 | 66 | 0.532759 | # Definition for a binary tree node.
# class TreeNode:
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution:
def trimBST(self, root: TreeNode, L: int, R: int) -> TreeNode:
if not root:
return None
if root.val<... | 0 | 0 | 0 | 396 | 0 | 0 | 0 | 0 | 23 |
2d982d9e3ea381e0c12055f558db9cd1ac20e3d2 | 9,925 | py | Python | set_up_grasp_models/check_models/thermodynamics_checks.py | martamatos/set_up_grasp_models | 0028f063c41104e3c0404956aa225e76aa6ac983 | [
"MIT"
] | null | null | null | set_up_grasp_models/check_models/thermodynamics_checks.py | martamatos/set_up_grasp_models | 0028f063c41104e3c0404956aa225e76aa6ac983 | [
"MIT"
] | 5 | 2019-05-14T17:05:41.000Z | 2019-05-29T13:17:11.000Z | set_up_grasp_models/check_models/thermodynamics_checks.py | martamatos/set_up_grasp_models | 0028f063c41104e3c0404956aa225e76aa6ac983 | [
"MIT"
] | null | null | null | import pandas as pd
def calculate_dG(data_dict: dict, gas_constant: float, temperature: float, rxn_order: list = None) -> tuple:
"""
Given a dictionary representing a GRASP input file, calculates the minimum and maximum reaction dGs based on the
standard dGs in thermoRxns and metabolite concentrations in... | 38.173077 | 120 | 0.643829 | import numpy as np
import pandas as pd
def _get_dG_list(rxn_names: list, stoic_matrix: np.ndarray, sub_conc: np.ndarray, prod_conc: np.ndarray,
dG_std: np.ndarray, gas_constant: float, temperature: float) -> tuple:
dG_list = []
dG_Q_list = []
ma_ratio_list = []
for rxn_i in range(le... | 48 | 0 | 0 | 0 | 0 | 4,055 | 0 | -3 | 114 |
d194ea8db0f61bff0f8a955602ce8f2eb76abe18 | 8,432 | py | Python | src/synthetic_data.py | tomogwen/fpdcluster | afbb16ce1e0e428304867084fb59d62ae3931b81 | [
"MIT"
] | 10 | 2020-06-05T12:46:21.000Z | 2021-04-19T10:46:46.000Z | src/synthetic_data.py | tomogwen/fpdcluster | afbb16ce1e0e428304867084fb59d62ae3931b81 | [
"MIT"
] | null | null | null | src/synthetic_data.py | tomogwen/fpdcluster | afbb16ce1e0e428304867084fb59d62ae3931b81 | [
"MIT"
] | null | null | null |
import clustering
if __name__ == '__main__':
seed = 0
dataset = gen_data2(seed, noise=0.1, n_samples=100)
diagrams = compute_diagrams(dataset)
diagrams_cluster = clustering.reformat_diagrams(diagrams)
r, M = clustering.pd_fuzzy(diagrams_cluster, 3, verbose=True, max_iter=20)
prin... | 27.736842 | 115 | 0.607448 |
import clustering
import numpy as np
from sklearn import datasets
import matplotlib.pyplot as plt
import dionysus as dion
import random
def plot_all(data, diagrams):
fig = plt.figure(figsize=(20, 10))
for i in range(len(data)):
num = 241 + i
ax = plt.subplot(num)
plt.scatter(data[i... | 0 | 0 | 0 | 0 | 0 | 7,457 | 0 | 8 | 340 |
2e69f73189a3759642774829299275d95d3f03ef | 3,821 | py | Python | controllers/pathfinder.py | endymecy/NDIToolbox | f7a0a642b4a778d9d0c131871f4bfb9822ecb3da | [
"BSD-4-Clause"
] | 5 | 2017-02-28T16:16:06.000Z | 2020-07-13T06:49:34.000Z | controllers/pathfinder.py | endymecy/NDIToolbox | f7a0a642b4a778d9d0c131871f4bfb9822ecb3da | [
"BSD-4-Clause"
] | 1 | 2018-08-19T19:08:14.000Z | 2018-08-19T19:08:14.000Z | controllers/pathfinder.py | endymecy/NDIToolbox | f7a0a642b4a778d9d0c131871f4bfb9822ecb3da | [
"BSD-4-Clause"
] | 4 | 2017-10-25T20:17:15.000Z | 2021-07-26T11:39:50.000Z | """pathfinder.py - specifies paths and common filenames"""
__author__ = 'Chris R. Coughlin'
def normalized(path_fn):
"""Decorator to normalize (os.path.normcase) paths"""
return normalize
| 25.993197 | 99 | 0.690395 | """pathfinder.py - specifies paths and common filenames"""
__author__ = 'Chris R. Coughlin'
from models import config
import os.path
import sys
def normalized(path_fn):
"""Decorator to normalize (os.path.normcase) paths"""
def normalize():
return os.path.normcase(path_fn())
return normalize
@n... | 0 | 3,076 | 0 | 0 | 0 | 38 | 0 | -14 | 508 |
1572db60c45a7a3e80068f389efcd4692bc26899 | 338 | py | Python | djapi/api/constants.py | dgouldin/djangocon-eu-2015 | 890057a3451231f96d15c65011d867dedfd5f9fa | [
"MIT"
] | null | null | null | djapi/api/constants.py | dgouldin/djangocon-eu-2015 | 890057a3451231f96d15c65011d867dedfd5f9fa | [
"MIT"
] | null | null | null | djapi/api/constants.py | dgouldin/djangocon-eu-2015 | 890057a3451231f96d15c65011d867dedfd5f9fa | [
"MIT"
] | null | null | null | TRANSACTION_STATUS_PENDING = 'pending'
TRANSACTION_STATUS_COMPLETE = 'complete'
TRANSACTION_STATUS_REFUNDED = 'refunded'
TRANSACTION_STATUSES = (
(TRANSACTION_STATUS_PENDING, TRANSACTION_STATUS_PENDING),
(TRANSACTION_STATUS_COMPLETE, TRANSACTION_STATUS_COMPLETE),
(TRANSACTION_STATUS_REFUNDED, TRANSACTION_ST... | 37.555556 | 63 | 0.837278 | TRANSACTION_STATUS_PENDING = 'pending'
TRANSACTION_STATUS_COMPLETE = 'complete'
TRANSACTION_STATUS_REFUNDED = 'refunded'
TRANSACTION_STATUSES = (
(TRANSACTION_STATUS_PENDING, TRANSACTION_STATUS_PENDING),
(TRANSACTION_STATUS_COMPLETE, TRANSACTION_STATUS_COMPLETE),
(TRANSACTION_STATUS_REFUNDED, TRANSACTION_ST... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
e81e348e3912f9783df345478bd8ba60a40bfcc1 | 2,040 | py | Python | test/test_minmax.py | shoaibmahmod7/Turbomachinery-Rotors-Balancing | 8bb4c1ec97c4646bcd69ed3398aafc7f985bc96d | [
"MIT"
] | 1 | 2022-02-03T17:14:16.000Z | 2022-02-03T17:14:16.000Z | test/test_minmax.py | shoaibmahmod7/Turbomachinery-Rotors-Balancing | 8bb4c1ec97c4646bcd69ed3398aafc7f985bc96d | [
"MIT"
] | null | null | null | test/test_minmax.py | shoaibmahmod7/Turbomachinery-Rotors-Balancing | 8bb4c1ec97c4646bcd69ed3398aafc7f985bc96d | [
"MIT"
] | null | null | null | import test_tools
'''This module is for testing Min_Max model solver'''
# Reading the test cases from config.yaml file, to add more tests follow the rules on the file
tests, tests_id, timeout = test_tools.get_tests_from_yaml('Min_max')
| 37.090909 | 118 | 0.673039 | import numpy as np
import sys
import yaml
import pytest
import test_tools
import hsbalance as hs
'''This module is for testing Min_Max model solver'''
# Reading the test cases from config.yaml file, to add more tests follow the rules on the file
tests, tests_id, timeout = test_tools.get_tests_from_yaml('Min_max')
@p... | 0 | 1,698 | 0 | 0 | 0 | 0 | 0 | -31 | 133 |
ecc51e60591a3f817b2262a421173a5caf35191e | 591 | py | Python | src/sequence/quick_sort.py | JadielTeofilo/General-Algorithms | dfcf86c6ecd727573079f8971187c47bdb7a37bb | [
"MIT"
] | null | null | null | src/sequence/quick_sort.py | JadielTeofilo/General-Algorithms | dfcf86c6ecd727573079f8971187c47bdb7a37bb | [
"MIT"
] | null | null | null | src/sequence/quick_sort.py | JadielTeofilo/General-Algorithms | dfcf86c6ecd727573079f8971187c47bdb7a37bb | [
"MIT"
] | null | null | null | ##################### QuickSort ###################
from typing import List
def quick_sort(nums: List[int]) -> List[int]:
""" Does recursive sorting using quick sort """
if len(nums) < 2:
return nums
mid: int = (len(nums) - 1)//2
smaller_values: List[int] = [num for i, num in enumerate(nums)
... | 36.9375 | 79 | 0.509306 | ##################### QuickSort ###################
from typing import List
def quick_sort(nums: List[int]) -> List[int]:
""" Does recursive sorting using quick sort """
if len(nums) < 2:
return nums
mid: int = (len(nums) - 1)//2
smaller_values: List[int] = [num for i, num in enumerate(nums)
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
1ee8b3b441e3e386e5383b05e72b69bbd71f1a7d | 15,586 | py | Python | noname.py | sxnxhxrxkx/nonamechan | 4830ee9852b790ae46d66bc1ed356b3f1b0a8404 | [
"MIT"
] | 1 | 2018-11-04T14:19:14.000Z | 2018-11-04T14:19:14.000Z | noname.py | sxnxhxrxkx/nonamechan | 4830ee9852b790ae46d66bc1ed356b3f1b0a8404 | [
"MIT"
] | null | null | null | noname.py | sxnxhxrxkx/nonamechan | 4830ee9852b790ae46d66bc1ed356b3f1b0a8404 | [
"MIT"
] | null | null | null | # Work with Python 3.6
import discord
# from wc import noname_wc
#import softalk as sf
import configparser
config = configparser.ConfigParser()
config.read('noname.ini')
TOKEN = config['noname']['TOKEN']
client = discord.Client()
client.run(TOKEN) | 40.801047 | 171 | 0.588926 | # Work with Python 3.6
import discord
import numpy as np
import pandas as pd
import random
import subprocess
import weather as wt
from nlu_yahoo import nluservice
from MorseCode import morse
# from wc import noname_wc
#import softalk as sf
from calender import getCalender, getCalLink, getCommandList
from news import ge... | 1,968 | 14,126 | 0 | 0 | 0 | 53 | 0 | 80 | 421 |
e033047e653a5d284cd1d9c31bd1fb747d758d2a | 5,522 | py | Python | tensorflow_federated/python/core/backends/iree/compiler.py | truthiswill/federated | d25eeac036dfc2a485120a195fd904223cfc823a | [
"Apache-2.0"
] | 1 | 2022-02-08T01:11:14.000Z | 2022-02-08T01:11:14.000Z | tensorflow_federated/python/core/backends/iree/compiler.py | truthiswill/federated | d25eeac036dfc2a485120a195fd904223cfc823a | [
"Apache-2.0"
] | null | null | null | tensorflow_federated/python/core/backends/iree/compiler.py | truthiswill/federated | d25eeac036dfc2a485120a195fd904223cfc823a | [
"Apache-2.0"
] | null | null | null | # Copyright 2020, The TensorFlow Federated Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 39.726619 | 80 | 0.74828 | # Copyright 2020, The TensorFlow Federated Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
39571e94baa89811230fb0af0126de9bc9159675 | 911 | py | Python | legacy/apps/smokegen_blob.py | tailintalent/PDE-Control | 7031909188e7ce217da2b1628236011d1dff161a | [
"MIT"
] | 22 | 2020-04-27T12:48:32.000Z | 2022-03-23T10:41:48.000Z | legacy/apps/smokegen_blob.py | tailintalent/PDE-Control | 7031909188e7ce217da2b1628236011d1dff161a | [
"MIT"
] | 5 | 2020-12-18T14:19:23.000Z | 2022-01-22T18:29:27.000Z | legacy/apps/smokegen_blob.py | tailintalent/PDE-Control | 7031909188e7ce217da2b1628236011d1dff161a | [
"MIT"
] | 3 | 2021-05-29T23:30:53.000Z | 2022-02-14T06:30:32.000Z |
# for scene in scenes("~/data/control/squares"):
# scene.remove()
scenecount = 1000
for scene_index in range(scenecount):
scene = new_scene("~/data/control/squares")
start_x, start_y, end_x, end_y = np.random.randint(10, 110, 4)
print(scene)
scenelength = 32
vx = (end_x-start_x) / float(scene... | 37.958333 | 92 | 0.614709 | from phi.fluidformat import *
# for scene in scenes("~/data/control/squares"):
# scene.remove()
scenecount = 1000
for scene_index in range(scenecount):
scene = new_scene("~/data/control/squares")
start_x, start_y, end_x, end_y = np.random.randint(10, 110, 4)
print(scene)
scenelength = 32
vx =... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 8 | 22 |
59c7971bdd0fbc42647fd2f3df68d614494ae493 | 12,561 | py | Python | mango/marketmaking/modelstatebuilderfactory.py | bednie/mango-explorer | 4575395488e97a1f8cb52cc567e3307f11a28932 | [
"MIT"
] | null | null | null | mango/marketmaking/modelstatebuilderfactory.py | bednie/mango-explorer | 4575395488e97a1f8cb52cc567e3307f11a28932 | [
"MIT"
] | null | null | null | mango/marketmaking/modelstatebuilderfactory.py | bednie/mango-explorer | 4575395488e97a1f8cb52cc567e3307f11a28932 | [
"MIT"
] | null | null | null | # # Warning
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
# LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
# NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIAB... | 33.857143 | 124 | 0.670727 | # # ⚠ Warning
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
# LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
# NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIA... | 11 | 0 | 0 | 250 | 0 | 10,862 | 0 | 200 | 340 |
5d4633ef46069b638eb4cd14d524fd4a344a3b49 | 2,753 | py | Python | backend/tomato/lib/cmd/bittorrent.py | dswd/ToMaTo | 355fd3a8c7f95dc72c62383b3edfa8f6c0396bf4 | [
"BSD-4-Clause-UC"
] | 2 | 2016-11-10T06:12:05.000Z | 2016-11-10T06:12:10.000Z | hostmanager/tomato/lib/cmd/bittorrent.py | dswd/ToMaTo | 355fd3a8c7f95dc72c62383b3edfa8f6c0396bf4 | [
"BSD-4-Clause-UC"
] | 2 | 2015-01-19T16:00:24.000Z | 2015-01-20T11:33:56.000Z | backend/tomato/lib/cmd/bittorrent.py | dswd/ToMaTo | 355fd3a8c7f95dc72c62383b3edfa8f6c0396bf4 | [
"BSD-4-Clause-UC"
] | 1 | 2016-11-10T06:12:15.000Z | 2016-11-10T06:12:15.000Z | # -*- coding: utf-8 -*-
# ToMaTo (Topology management software)
# Copyright (C) 2010 Dennis Schwerdel, University of Kaiserslautern
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either vers... | 30.588889 | 155 | 0.726843 | # -*- coding: utf-8 -*-
# ToMaTo (Topology management software)
# Copyright (C) 2010 Dennis Schwerdel, University of Kaiserslautern
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either vers... | 0 | 0 | 0 | 0 | 0 | 1,641 | 0 | 14 | 230 |
d12742fbf604ea579708c7757f0f38ebaac260d8 | 667 | py | Python | hackathons/migrations/0014_auto_20190703_0453.py | Tookmund/hackerforce | d757910db1631e26e489a10a99fa67cd74292c4e | [
"Apache-2.0"
] | 11 | 2019-11-11T23:27:21.000Z | 2021-07-19T16:41:44.000Z | hackathons/migrations/0014_auto_20190703_0453.py | Tookmund/hackerforce | d757910db1631e26e489a10a99fa67cd74292c4e | [
"Apache-2.0"
] | 11 | 2019-12-24T17:10:05.000Z | 2021-06-09T18:22:59.000Z | hackathons/migrations/0014_auto_20190703_0453.py | hackumass/hackerforce | dfb6ac1304a7db21853765de9da795e8e9ef20bf | [
"Apache-2.0"
] | 7 | 2019-11-21T03:32:06.000Z | 2021-07-18T15:30:29.000Z | # Generated by Django 2.1.9 on 2019-07-03 04:53
| 27.791667 | 161 | 0.593703 | # Generated by Django 2.1.9 on 2019-07-03 04:53
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('hackathons', '0013_auto_20190702_0649'),
]
operations = [
migrations.AddField(
model_name='lead',
name='times_contac... | 0 | 0 | 0 | 553 | 0 | 0 | 0 | 19 | 46 |
ed9008157534fcd41bdd7451e2a5f8dc32ad3e1a | 7,450 | py | Python | oidv6/samples/run.py | chuangzhu/OIDv6 | e46e66770c520c02e268f0b021fa72451c79ad1e | [
"MIT"
] | null | null | null | oidv6/samples/run.py | chuangzhu/OIDv6 | e46e66770c520c02e268f0b021fa72451c79ad1e | [
"MIT"
] | null | null | null | oidv6/samples/run.py | chuangzhu/OIDv6 | e46e66770c520c02e268f0b021fa72451c79ad1e | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Open Images Dataset V6
python oidv6/samples/run.py <command> --classes ____
[--dataset Dataset --type_data train --limit 0 --multi_classes --yes --no_labels --hide_metadata --no_clear_shell]
"""
# #############################################################... | 45.426829 | 120 | 0.468725 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Массовая загрузка набора данных Open Images Dataset V6
python oidv6/samples/run.py <command> --classes названия_классов_или_текстовый_файл
[--dataset Dataset --type_data train --limit 0 --multi_classes --yes --no_labels --hide_metadata --no_clear_shell]
"""
# ##... | 2,888 | 0 | 0 | 4,634 | 0 | 21 | 0 | 35 | 262 |
fe4004b04e6ea7f0d42e97de6ac9ec98151e1cda | 4,585 | py | Python | tests/_internal/test_auth_handling.py | unparalleled-js/py42 | 8c6b054ddd8c2bfea92bf77b0d648af76f1efcf1 | [
"MIT"
] | 1 | 2020-08-18T22:00:22.000Z | 2020-08-18T22:00:22.000Z | tests/_internal/test_auth_handling.py | unparalleled-js/py42 | 8c6b054ddd8c2bfea92bf77b0d648af76f1efcf1 | [
"MIT"
] | null | null | null | tests/_internal/test_auth_handling.py | unparalleled-js/py42 | 8c6b054ddd8c2bfea92bf77b0d648af76f1efcf1 | [
"MIT"
] | 1 | 2021-05-10T23:33:34.000Z | 2021-05-10T23:33:34.000Z |
ORIGINAL_VALUE = "test-original-value"
UPDATED_VALUE = "test-updated-value"
CUSTOM_NAME = "Custom-Name"
DEFAULT_HEADER = "Authorization"
TEST_SECRET = "TEST-SECRET"
| 38.208333 | 116 | 0.844711 | import pytest
from requests import Response
from py42._internal.auth_handling import AuthHandler
from py42._internal.auth_handling import HeaderModifier
from py42._internal.auth_handling import TokenProvider
ORIGINAL_VALUE = "test-original-value"
UPDATED_VALUE = "test-updated-value"
CUSTOM_NAME = "Custom-Name"
DEFAUL... | 0 | 233 | 0 | 0 | 0 | 3,592 | 0 | 98 | 479 |
467c004ada7353bc4bb87367e3774a1bba52e193 | 3,027 | py | Python | dfu/host/hex2dfu.py | LeHonk/usb-stack | 3869706a951eb00bf9ab630f0adb27c5676c3426 | [
"MIT"
] | null | null | null | dfu/host/hex2dfu.py | LeHonk/usb-stack | 3869706a951eb00bf9ab630f0adb27c5676c3426 | [
"MIT"
] | null | null | null | dfu/host/hex2dfu.py | LeHonk/usb-stack | 3869706a951eb00bf9ab630f0adb27c5676c3426 | [
"MIT"
] | null | null | null | #!/usr/bin/env python2.7
# TODO: Actual values
devid = { 'p24fj256gb106': 0xFFFF
, 'p18f2550': 0x1234
}
targetmem = { 'int_flash': 0
, 'int_eeprom': 1
# , 'ext_flash': 2
# , 'ext_eeprom': 3
}
# TODO: Actual values
maxmem = { 'p24fj256gb106': {'int_flash':255*1024, 'int_eeprom':2048}
, 'p18f... | 36.914634 | 164 | 0.682524 | #!/usr/bin/env python2.7
# TODO: Actual values
devid = { 'p24fj256gb106': 0xFFFF
, 'p18f2550': 0x1234
}
targetmem = { 'int_flash': 0
, 'int_eeprom': 1
# , 'ext_flash': 2
# , 'ext_eeprom': 3
}
# TODO: Actual values
maxmem = { 'p24fj256gb106': {'int_flash':255*1024, 'int_eeprom':2048}
, 'p18f... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 | 23 |
43d92d931d95fafab64fab33655d9809b86351cf | 2,098 | py | Python | plots/midterm/FR_illustration.py | jokteur/ASMA | 25ac8a0455c680232d56c18d31de62c3188b7153 | [
"MIT"
] | 2 | 2021-11-01T09:13:17.000Z | 2022-03-08T14:34:16.000Z | plots/midterm/FR_illustration.py | jokteur/ASMA | 25ac8a0455c680232d56c18d31de62c3188b7153 | [
"MIT"
] | null | null | null | plots/midterm/FR_illustration.py | jokteur/ASMA | 25ac8a0455c680232d56c18d31de62c3188b7153 | [
"MIT"
] | null | null | null | import os
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import gridspec
import matplotlib.animation as animation
from flowrect.simulations import particle_population
# Plot saving parameters
save = False
save_path = ""
save_name = "m_t2.pdf"
# Simulation parameters
Lambda = np.array([33.0, 8.0]... | 22.804348 | 87 | 0.64204 | import time
import copy
import os
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
from matplotlib import gridspec
from matplotlib.animation import FuncAnimation
import matplotlib.animation as animation
import flowrect
from flowrect.simulations.util import calculate_age, calculate_mt, eta_SRM
fro... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 83 | 134 |
29d451b8dd8c0ba5e18591eb336cbb335fe1a3fb | 3,311 | py | Python | tk_recoder/tab_text_converter.py | anton-pribora/py-recoder | ee3cd3a6dc9ff78081ed963a16d765d0a004f4d6 | [
"MIT"
] | null | null | null | tk_recoder/tab_text_converter.py | anton-pribora/py-recoder | ee3cd3a6dc9ff78081ed963a16d765d0a004f4d6 | [
"MIT"
] | null | null | null | tk_recoder/tab_text_converter.py | anton-pribora/py-recoder | ee3cd3a6dc9ff78081ed963a16d765d0a004f4d6 | [
"MIT"
] | null | null | null | import tkinter as tk
from tkinter import ttk
import tkinter.scrolledtext as st
from functools import partial
"""
" "
"""
def init_frame(self, frame: tk.Frame):
"""
" "
:param tk_recoder.gui.Gui self:
:param frame:
:return: None
"""
buttons = tk.Frame(frame)
buttons.pack(fill... | 38.952941 | 116 | 0.598309 | import tkinter as tk
from tkinter import ttk
import tkinter.scrolledtext as st
from tkinter import filedialog
from functools import partial
"""
Вкладка "перекодировать текст"
"""
def init_frame(self, frame: tk.Frame):
"""
Инициализация вкладки "Перекодировать текст"
:param tk_recoder.gui.Gui self: Осно... | 420 | 0 | 0 | 0 | 0 | 1,183 | 0 | 9 | 76 |
e35513963af5102e6dfdfe622a13488cd9004a55 | 595 | py | Python | biggee.py | simretmengesha/PublicNLPA | eb62b32a3eb3f7db6fc03579c36f252b72266b65 | [
"MIT"
] | null | null | null | biggee.py | simretmengesha/PublicNLPA | eb62b32a3eb3f7db6fc03579c36f252b72266b65 | [
"MIT"
] | null | null | null | biggee.py | simretmengesha/PublicNLPA | eb62b32a3eb3f7db6fc03579c36f252b72266b65 | [
"MIT"
] | null | null | null |
# Bigram formation
# using list comprehension + enumerate() + split()
# initializing list
test_list = [' ', ' ']
# printing the original list
print ("The original list is : " + str(test_list))
# using list comprehension + enumerate() + split()
# for Bigram formation
res = [(x, i.split()[j ... | 33.055556 | 171 | 0.692437 |
# Bigram formation
# using list comprehension + enumerate() + split()
# initializing list
test_list = ['በሙቀት ጀምሮ በቅዝቃዜ መጨረስ የዚህ ዓለም መገለጫ ሆኗል እልልታ በኡኡታ፣ ሠርግ በግልግል፣ ማሬ የሚለው ቃል እሬቴ በሚልይለወጣል', 'ጨርሰው የማይሰሩ አሳሳቢ አይደሉም፣ አይሠሩምና። ብልሽት ያለባቸው ማሞቂያዎች ግን ሰውዬው ሲሞክራቸው ይሠራሉ ']
# printing the original list
print ("The original list ... | 369 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
7190d4a76e2659164c8852533d26134a504bdea3 | 1,524 | py | Python | apps/dcl/mdl/m_mdl.py | yt7589/cvep | 1f77169bdbb614ea32a30d98eba87b028b19890b | [
"Apache-2.0"
] | null | null | null | apps/dcl/mdl/m_mdl.py | yt7589/cvep | 1f77169bdbb614ea32a30d98eba87b028b19890b | [
"Apache-2.0"
] | null | null | null | apps/dcl/mdl/m_mdl.py | yt7589/cvep | 1f77169bdbb614ea32a30d98eba87b028b19890b | [
"Apache-2.0"
] | 1 | 2020-09-24T04:28:20.000Z | 2020-09-24T04:28:20.000Z | #
#
| 33.130435 | 83 | 0.599738 | #
#
from os import stat
import pymongo
from apps.wxs.model.m_mongodb import MMongoDb
class MMdl(object):
def __init__(self):
self.name = 'apps.wxs.model.MModel'
@staticmethod
def is_model_exists(model_name):
query_cond = {'model_name': model_name}
fields = {'model_id'... | 36 | 1,177 | 0 | 221 | 0 | 0 | 0 | 15 | 93 |
04031ae8151added17a1d39405820110dd82354f | 661 | py | Python | dags/book_data.py | blue-yonder/airflow-plugin-demo | c7044f97532c2f2a3d674762498cb6e58c3e1a1c | [
"CC0-1.0"
] | 55 | 2016-07-23T21:09:43.000Z | 2021-05-26T23:48:55.000Z | dags/book_data.py | blue-yonder/airflow-plugin-demo | c7044f97532c2f2a3d674762498cb6e58c3e1a1c | [
"CC0-1.0"
] | null | null | null | dags/book_data.py | blue-yonder/airflow-plugin-demo | c7044f97532c2f2a3d674762498cb6e58c3e1a1c | [
"CC0-1.0"
] | 21 | 2016-10-24T17:15:32.000Z | 2021-07-02T10:38:25.000Z | """
Workflow definition to book data
"""
from __future__ import division, absolute_import, print_function
from datetime import datetime, timedelta
from airflow import DAG
from airflow.operators import (BookData)
dag_id = "book_data"
schedule_interval = None
default_args = {
'owner': 'europython',
'depends_... | 19.441176 | 64 | 0.709531 | """
Workflow definition to book data
"""
from __future__ import division, absolute_import, print_function
from datetime import datetime, timedelta
from airflow import DAG
from airflow.operators import (
BookData
)
dag_id = "book_data"
schedule_interval = None
default_args = {
'owner': 'europython',
'de... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 6 | 0 |
8e453bcd4f0e7baa3c63a6cdd373f14f6c2a93bc | 1,103 | py | Python | alex/components/tts/test_voicerss.py | oplatek/alex | 73af644ec35c8a1cd0c37cd478c2afc1db717e0b | [
"Apache-2.0"
] | 184 | 2015-02-11T04:14:41.000Z | 2022-03-24T21:43:58.000Z | alex/components/tts/test_voicerss.py | oplatek/alex | 73af644ec35c8a1cd0c37cd478c2afc1db717e0b | [
"Apache-2.0"
] | 69 | 2015-01-11T04:57:22.000Z | 2019-04-24T10:25:56.000Z | alex/components/tts/test_voicerss.py | oplatek/alex | 73af644ec35c8a1cd0c37cd478c2afc1db717e0b | [
"Apache-2.0"
] | 61 | 2015-03-04T10:52:13.000Z | 2022-03-04T12:14:06.000Z | import alex.utils.audio as audio
__author__ = 'm2rtin'
| 30.638889 | 91 | 0.56029 | from unittest import TestCase
from alex.components.tts.voicerss import VoiceRssTTS
import alex.utils.audio as audio
import wave
from alex.utils.config import as_project_path
__author__ = 'm2rtin'
class TestVoiceRssTTS(TestCase):
def test_synthesise_en(self):
text = 'Hello, this is alex, the call is reco... | 0 | 0 | 0 | 882 | 0 | 0 | 0 | 53 | 112 |
1639b5d6c5f1c18d8197d2c4d3ba9d689afeb72f | 2,096 | py | Python | tests/test_cpu_ins_txa.py | hspaans/6502-emulator | 02b802c43caf8a04833dd1f3d48077f9e2175e7e | [
"MIT"
] | null | null | null | tests/test_cpu_ins_txa.py | hspaans/6502-emulator | 02b802c43caf8a04833dd1f3d48077f9e2175e7e | [
"MIT"
] | null | null | null | tests/test_cpu_ins_txa.py | hspaans/6502-emulator | 02b802c43caf8a04833dd1f3d48077f9e2175e7e | [
"MIT"
] | null | null | null | """
TXA - Transfer Register X to Accumulator.
A = X
Copies the current contents of the X register into the accumulator and sets
the zero and negative flags as appropriate.
Processor Status after use:
+------+-------------------+--------------------------+
| Flag | Description | State |
+===... | 30.823529 | 75 | 0.380725 | """
TXA - Transfer Register X to Accumulator.
A = X
Copies the current contents of the X register into the accumulator and sets
the zero and negative flags as appropriate.
Processor Status after use:
+------+-------------------+--------------------------+
| Flag | Description | State |
+===... | 0 | 639 | 0 | 0 | 0 | 0 | 0 | -17 | 67 |
68da65c7b02b2e46698372cf6c71f0e9a96ad209 | 392 | py | Python | HSCTF/crypto/Randomization 1/solve.py | deut-erium/WriteUps | 36b4193f5fab9f95527a48626ecba631d5a03796 | [
"MIT"
] | 11 | 2020-06-06T05:28:27.000Z | 2022-01-09T00:42:49.000Z | 2020/HSCTF/crypto/Randomization 1/solve.py | CSEA-IITB/WriteUps | 46e7f36b0c4ef182cbaf375fd10fda954b6667a0 | [
"MIT"
] | 1 | 2020-09-06T18:19:55.000Z | 2020-09-06T18:19:55.000Z | HSCTF/crypto/Randomization 1/solve.py | deut-erium/WriteUps | 36b4193f5fab9f95527a48626ecba631d5a03796 | [
"MIT"
] | 6 | 2020-06-06T05:36:43.000Z | 2021-08-11T10:17:18.000Z | import pwn
HOST, PORT = "crypto.hsctf.com", 6001
rem = pwn.remote(HOST, PORT)
rem.recvline()
data = rem.recvline()
initial = data.decode().strip().split(':')[-1]
print(initial)
initial = int(initial)
for i in range(10):
rem.sendline(str(nextval(initial)).encode())
print(rem.recvline().decode())
initial ... | 19.6 | 48 | 0.668367 | import pwn
HOST, PORT = "crypto.hsctf.com", 6001
rem = pwn.remote(HOST, PORT)
rem.recvline()
data = rem.recvline()
def nextval(num):
return (num*0x25 + 0x41)&0xff
initial = data.decode().strip().split(':')[-1]
print(initial)
initial = int(initial)
for i in range(10):
rem.sendline(str(nextval(initial)).enco... | 0 | 0 | 0 | 0 | 0 | 30 | 0 | 0 | 23 |
f43edadce6082236a716b23df8d2ddde42461d1b | 4,086 | py | Python | camply/utils/yaml_utils.py | juftin/camply | d365ed10a62248edc428a68a8ee96743c4b8fa98 | [
"MIT"
] | 123 | 2021-05-19T04:56:47.000Z | 2022-03-23T19:04:45.000Z | camply/utils/yaml_utils.py | juftin/camply | d365ed10a62248edc428a68a8ee96743c4b8fa98 | [
"MIT"
] | 11 | 2021-05-25T20:22:14.000Z | 2022-03-05T16:31:32.000Z | camply/utils/yaml_utils.py | juftin/camply | 62d1a4423710a5e0f0366b5e9204b3639b358070 | [
"MIT"
] | 21 | 2021-05-24T05:53:24.000Z | 2022-03-31T02:03:41.000Z | #!/usr/bin/env python3
# Author:: Justin Flannery (mailto:juftin@juftin.com)
"""
YAML Utilities for Camply
"""
from datetime import datetime
import logging
import os
from pathlib import Path
from re import compile
from typing import Dict, Tuple
from yaml import load, SafeLoader
from camply.config import Search... | 34.627119 | 95 | 0.659325 | #!/usr/bin/env python3
# Author:: Justin Flannery (mailto:juftin@juftin.com)
"""
YAML Utilities for Camply
"""
from datetime import datetime
import logging
import os
from pathlib import Path
from re import compile
from typing import Dict, Tuple
from yaml import load, SafeLoader
from camply.config import Search... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
b31ed0506aad94a74db97c7798537089fe97130a | 9,136 | py | Python | TD/src/plots_nips2016.py | lucasgit/rl | 1c4bbfad0b11c040ece2b9a384f3781de2c729ca | [
"MIT"
] | 1 | 2022-01-21T13:52:50.000Z | 2022-01-21T13:52:50.000Z | TD/src/plots_nips2016.py | lucaslehnert/pgq | 1c4bbfad0b11c040ece2b9a384f3781de2c729ca | [
"MIT"
] | null | null | null | TD/src/plots_nips2016.py | lucaslehnert/pgq | 1c4bbfad0b11c040ece2b9a384f3781de2c729ca | [
"MIT"
] | null | null | null | '''
Created on May 23, 2016
@author: Lucas Lehnert (lucas.lehnert@mail.mcgill.ca)
Script to generate all plots from the NIPS 2016 paper.
'''
import matplotlib
matplotlib.use( 'agg' )
matplotlib.rcParams['text.usetex'] = True
matplotlib.rcParams['text.latex.preamble'] = [r'\usepackage{amsmath}']
import os
experimen... | 38.225941 | 118 | 0.611208 | '''
Created on May 23, 2016
@author: Lucas Lehnert (lucas.lehnert@mail.mcgill.ca)
Script to generate all plots from the NIPS 2016 paper.
'''
import matplotlib
matplotlib.use( 'agg' )
matplotlib.rcParams['text.usetex'] = True
matplotlib.rcParams['text.latex.preamble'] = [r'\usepackage{amsmath}']
import matplotlib.p... | 0 | 0 | 0 | 0 | 0 | 8,361 | 0 | 19 | 296 |
434db8b2f563775855ef95e274774e84780d15b1 | 5,444 | py | Python | tests/aggregate/elements.py | nadirhamid/protean | d31bc634e05c9221e82136bf18c2ceaa0982c1c8 | [
"BSD-3-Clause"
] | null | null | null | tests/aggregate/elements.py | nadirhamid/protean | d31bc634e05c9221e82136bf18c2ceaa0982c1c8 | [
"BSD-3-Clause"
] | null | null | null | tests/aggregate/elements.py | nadirhamid/protean | d31bc634e05c9221e82136bf18c2ceaa0982c1c8 | [
"BSD-3-Clause"
] | null | null | null | # Standard Library Imports
# Protean
# Aggregates to test Identity
# Aggregates to test Subclassing
# Aggregates to test Abstraction # START #
# Aggregates to test Abstraction # END #
# Aggregates to test Meta Info overriding # START #
# Aggregates to test Meta Info overriding # END #
# Aggreg... | 25.203704 | 88 | 0.722998 | # Standard Library Imports
from datetime import datetime
from typing import List
# Protean
from protean.core.aggregate import BaseAggregate
from protean.core.entity import BaseEntity
from protean.core.field.association import HasMany, HasOne, Reference
from protean.core.field.basic import Auto, DateTime, Integer, Stri... | 0 | 0 | 0 | 4,003 | 0 | 0 | 0 | 188 | 839 |
852e2170c0125511f1261888c3694601b5d7bab3 | 10,455 | py | Python | bert_senteval.py | heartcored98/Trasnformer_Anatomy | 2100f690947abe513d9e5fef9df0dd9e44e17a43 | [
"MIT"
] | 16 | 2020-07-05T20:50:23.000Z | 2021-04-26T20:13:27.000Z | bert_senteval.py | heartcored98/Trasnformer_Anatomy | 2100f690947abe513d9e5fef9df0dd9e44e17a43 | [
"MIT"
] | null | null | null | bert_senteval.py | heartcored98/Trasnformer_Anatomy | 2100f690947abe513d9e5fef9df0dd9e44e17a43 | [
"MIT"
] | 3 | 2020-11-02T14:32:07.000Z | 2021-12-15T13:20:15.000Z | #!/usr/bin/env python
# coding: utf-8
# In[ ]:
#%load_ext autoreload
#%autoreload 2
# In[ ]:
import sys
import torch
import numpy as np
import argparse
from tqdm import tqdm
import os
PATH_SENTEVAL = './SentEval'
PATH_TO_DATA = './SentEval/data/'
PATH_TO_CACHE = './cache/'
sys.path.insert(0, PATH_SENTEVAL)
see... | 33.402556 | 190 | 0.616069 | #!/usr/bin/env python
# coding: utf-8
# In[ ]:
#%load_ext autoreload
#%autoreload 2
# In[ ]:
import sys
import torch
import numpy as np
import time
import hashlib
from os import listdir
from os.path import isfile, join
import pickle
import argparse
import json
from tqdm import tqdm
from copy import deepcopy
impo... | 0 | 0 | 0 | 0 | 0 | 6,340 | 0 | 14 | 314 |
0668d699300db3de6998a525c2564293163ee37d | 2,963 | py | Python | sensors_test.py | kipkemoimayor/Traffic_control_system | 840c01b8c031d613524b87b91c8d938a33348b3c | [
"MIT"
] | 2 | 2019-06-15T09:58:08.000Z | 2020-08-24T09:51:37.000Z | sensors_test.py | kipkemoimayor/Traffic_control_system | 840c01b8c031d613524b87b91c8d938a33348b3c | [
"MIT"
] | null | null | null | sensors_test.py | kipkemoimayor/Traffic_control_system | 840c01b8c031d613524b87b91c8d938a33348b3c | [
"MIT"
] | 2 | 2019-06-26T07:30:05.000Z | 2020-08-24T09:51:42.000Z | import RPi.GPIO as GPIO
dis=0
while True:
# Setup triggers and Echos of all sensors
GPIO.setmode(GPIO.BOARD)
TRIG=11
ECHO=13
GPIO.setup(TRIG,GPIO.OUT)
GPIO.setup(3,GPIO.OUT)
GPIO.setup(ECHO,GPIO.IN)
GPIO.setup(5,GPIO.IN)
GPIO.setup(35,GPIO.OUT)
GPIO.setup(31,GPIO.OUT)
GPIO.... | 20.576389 | 45 | 0.552143 | import RPi.GPIO as GPIO
import time
dis=0
while True:
# Setup triggers and Echos of all sensors
GPIO.setmode(GPIO.BOARD)
TRIG=11
ECHO=13
GPIO.setup(TRIG,GPIO.OUT)
GPIO.setup(3,GPIO.OUT)
GPIO.setup(ECHO,GPIO.IN)
GPIO.setup(5,GPIO.IN)
GPIO.setup(35,GPIO.OUT)
GPIO.setup(31,GPIO.OU... | 0 | 0 | 0 | 0 | 0 | 1,922 | 0 | -10 | 184 |
d7a3717a0624d7d45c29409cb86a2357bad037fd | 2,829 | py | Python | xbrlparser.py | emhlaos/bmv-scrapper | 70df08cddae4c2b3e472c3c22e639fca07a14c86 | [
"MIT"
] | 4 | 2018-03-01T03:22:45.000Z | 2021-09-25T02:44:51.000Z | xbrlparser.py | emhlaos/bmv-scrapper | 70df08cddae4c2b3e472c3c22e639fca07a14c86 | [
"MIT"
] | null | null | null | xbrlparser.py | emhlaos/bmv-scrapper | 70df08cddae4c2b3e472c3c22e639fca07a14c86 | [
"MIT"
] | 3 | 2020-04-22T15:10:29.000Z | 2021-06-23T03:45:08.000Z | """
Copyright C.C.:
Emiliano Hernandez Laos
https://github.com/emhlaos/
28/02/2018
"""
from urllib.request import urlopen
import os
from io import BytesIO
from zipfile import ZipFile
#LOAD FUNCTION:
currentdirectory = os.getcwd()
xbrldirectory = currentdirectory+"/xbrl"
if not os.path.exist... | 36.74026 | 112 | 0.487098 | """
Copyright C.C.:
Emiliano Hernandez Laos
https://github.com/emhlaos/
28/02/2018
"""
from urllib.request import urlopen
import os
from io import BytesIO
from zipfile import ZipFile
#LOAD FUNCTION:
currentdirectory = os.getcwd()
xbrldirectory = currentdirectory+"/xbrl"
if not os.path.exist... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
b56ad7a7bc1fe9805d9331eef23690d49bce762e | 2,351 | py | Python | hpedockerplugin/cmd/cmd_createshare.py | renovate-bot/python-hpedockerplugin | b7fa6b3193fa6dd42574585b4c621ff6a16babc9 | [
"Apache-2.0"
] | 49 | 2016-06-14T22:25:40.000Z | 2021-04-05T05:00:59.000Z | hpedockerplugin/cmd/cmd_createshare.py | imran-ansari/python-hpedockerplugin | e2726f48ac793dc894100e3772c40ce89bfe9bb8 | [
"Apache-2.0"
] | 550 | 2016-07-25T12:01:12.000Z | 2021-11-15T17:52:40.000Z | hpedockerplugin/cmd/cmd_createshare.py | imran-ansari/python-hpedockerplugin | e2726f48ac793dc894100e3772c40ce89bfe9bb8 | [
"Apache-2.0"
] | 96 | 2016-06-01T22:07:03.000Z | 2021-06-22T09:05:05.000Z |
from oslo_log import log as logging
LOG = logging.getLogger(__name__)
| 40.534483 | 78 | 0.633348 | import six
from oslo_log import log as logging
from hpedockerplugin.cmd import cmd
from hpedockerplugin import exception
LOG = logging.getLogger(__name__)
class CreateShareCmd(cmd.Cmd):
def __init__(self, file_mgr, share_args):
self._file_mgr = file_mgr
self._etcd = file_mgr.get_etcd()
... | 0 | 0 | 0 | 2,169 | 0 | 0 | 0 | 19 | 90 |
fd444aca0dbc53e3b47c5e154be553cc2f88d847 | 156 | py | Python | tests/asp/cautious/sum.example11.cautious.asp.test.py | bernardocuteri/wasp | 05c8f961776dbdbf7afbf905ee00fc262eba51ad | [
"Apache-2.0"
] | 19 | 2015-12-03T08:53:45.000Z | 2022-03-31T02:09:43.000Z | tests/asp/cautious/sum.example11.cautious.asp.test.py | bernardocuteri/wasp | 05c8f961776dbdbf7afbf905ee00fc262eba51ad | [
"Apache-2.0"
] | 80 | 2017-11-25T07:57:32.000Z | 2018-06-10T19:03:30.000Z | tests/asp/cautious/sum.example11.cautious.asp.test.py | bernardocuteri/wasp | 05c8f961776dbdbf7afbf905ee00fc262eba51ad | [
"Apache-2.0"
] | 6 | 2015-01-15T07:51:48.000Z | 2020-06-18T14:47:48.000Z | input = """
1 2 3 2 3 4 5
1 3 3 2 2 4 5
1 4 3 2 2 3 5
1 5 0 0
5 6 4 3 0 2 3 4 2 2 2
1 1 1 1 6
0
4 c
3 b
2 a
0
B+
0
B-
1
0
1
"""
output = """
INCOHERENT
"""
| 6.782609 | 21 | 0.487179 | input = """
1 2 3 2 3 4 5
1 3 3 2 2 4 5
1 4 3 2 2 3 5
1 5 0 0
5 6 4 3 0 2 3 4 2 2 2
1 1 1 1 6
0
4 c
3 b
2 a
0
B+
0
B-
1
0
1
"""
output = """
INCOHERENT
"""
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
a7a70d0fc999c0ac172fafb16600e4829015a6d0 | 1,660 | py | Python | code4step2/register_images.py | yukeyi/MCDS-Capstone | f7ce48fc5d3f5f96c1f29556585ed2338683c7d2 | [
"MIT"
] | null | null | null | code4step2/register_images.py | yukeyi/MCDS-Capstone | f7ce48fc5d3f5f96c1f29556585ed2338683c7d2 | [
"MIT"
] | null | null | null | code4step2/register_images.py | yukeyi/MCDS-Capstone | f7ce48fc5d3f5f96c1f29556585ed2338683c7d2 | [
"MIT"
] | null | null | null |
LOAD_DIR = '/pylon5/ac5616p/Data/HeartSegmentationProject/CAP_challenge/CAP_challenge_training_set/test2/brain/total/'
'''
Generator function to get one pair of fixed and moving image at a time
(fixed, moving) are viewed as without order.
(a, b) is the same as (b, a), so (b, a) won't be registered
'''
'''
Register t... | 31.923077 | 118 | 0.655422 | import os
import shutil
import pickle as pkl
import numpy as np
import SimpleITK as sitk
from data_registration import RegHearts
LOAD_DIR = '/pylon5/ac5616p/Data/HeartSegmentationProject/CAP_challenge/CAP_challenge_training_set/test2/brain/total/'
'''
Generator function to get one pair of fixed and moving image at a ... | 0 | 0 | 0 | 0 | 246 | 863 | 0 | -3 | 176 |
d2dda46de2a802ec9a1d557c8bb1545bff13d2d7 | 4,235 | py | Python | octoprint_LCD1602/__init__.py | Marien1993/LCD-octoprint | eae8fd9b2ab5a5799b25b6f0684b081c77cc0aad | [
"MIT"
] | null | null | null | octoprint_LCD1602/__init__.py | Marien1993/LCD-octoprint | eae8fd9b2ab5a5799b25b6f0684b081c77cc0aad | [
"MIT"
] | null | null | null | octoprint_LCD1602/__init__.py | Marien1993/LCD-octoprint | eae8fd9b2ab5a5799b25b6f0684b081c77cc0aad | [
"MIT"
] | null | null | null | # coding=utf-8
"""
LCD1602 Plugin for Octoprint
"""
from __future__ import absolute_import
import octoprint.plugin
__plugin_name__ = "LCD1602 I2c display"
| 27.147436 | 120 | 0.651948 | # coding=utf-8
"""
LCD1602 Plugin for Octoprint
"""
from __future__ import absolute_import
from octoprint.printer.estimation import PrintTimeEstimator
import octoprint.plugin
import octoprint.events
from RPLCD.i2c import CharLCD
import time
import datetime
import os
import sys
from fake_rpi import printf
import fak... | 0 | 0 | 0 | 3,590 | 0 | 230 | 0 | 9 | 244 |
f282ae2d0aacafe56cfc3e396879274fc628595a | 4,876 | py | Python | assignment2/PythonApplication1.py | JungChaeMoon/room_escape | 1417caf6b9cc6228b2f1faf533d73c986cc04704 | [
"MIT"
] | null | null | null | assignment2/PythonApplication1.py | JungChaeMoon/room_escape | 1417caf6b9cc6228b2f1faf533d73c986cc04704 | [
"MIT"
] | null | null | null | assignment2/PythonApplication1.py | JungChaeMoon/room_escape | 1417caf6b9cc6228b2f1faf533d73c986cc04704 | [
"MIT"
] | null | null | null |
setGameOption(GameOption.INVENTORY_BUTTON, False)
setGameOption(GameOption.MESSAGE_BOX_BUTTON, False)
main_scene = Scene("", "images/backgroud.PNG")
scene1 = Scene("Loopy ", "images/backgroud.PNG")
scene2 = Scene("Lion ", "images/backgroud.PNG")
help_message = showMessage(... | 14.426036 | 209 | 0.561116 | from bangtal import *
import random
import copy
import time
setGameOption(GameOption.INVENTORY_BUTTON, False)
setGameOption(GameOption.MESSAGE_BOX_BUTTON, False)
main_scene = Scene("퍼즐게임", "images/backgroud.PNG")
scene1 = Scene("Loopy 퍼즐", "images/backgroud.PNG")
scene2 ... | 66 | 0 | 0 | 0 | 0 | 3,310 | 0 | -28 | 348 |
40b5fd4c0ce2924a38851bdad6bd0745fb2bd736 | 349 | py | Python | akeydo/plugins/__init__.py | dangle/vfio-kvm | 13ed6f6b2ebbc2e23afe267866e321a2fd51a337 | [
"MIT"
] | 30 | 2021-01-15T18:22:26.000Z | 2021-06-02T14:10:40.000Z | akeydo/plugins/__init__.py | dangle/vfio-kvm | 13ed6f6b2ebbc2e23afe267866e321a2fd51a337 | [
"MIT"
] | 11 | 2021-01-23T05:37:06.000Z | 2021-04-21T21:50:37.000Z | akeydo/plugins/__init__.py | dangle/vfio-kvm | 13ed6f6b2ebbc2e23afe267866e321a2fd51a337 | [
"MIT"
] | null | null | null | import sys
if sys.version_info < (3, 10):
from importlib_metadata import entry_points
else:
from importlib.metadata import entry_points
from . import (cpu, devices, gpu, memory)
__all__ = (
"cpu",
"devices",
"gpu",
"installed_plugins",
"memory",
)
installed_plugins = entry_points(group=... | 13.96 | 48 | 0.647564 | import sys
if sys.version_info < (3, 10):
from importlib_metadata import entry_points
else:
from importlib.metadata import entry_points
from . import (
cpu,
devices,
gpu,
memory,
)
__all__ = (
"cpu",
"devices",
"gpu",
"installed_plugins",
"memory",
)
installed_plugins = ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 19 | 0 |
5d36cde055910519c7a52a7522ef39460d4a9945 | 3,888 | py | Python | pltools/train/module.py | PhoenixDL/PytorchLightningTools | 86185062d4792e6d5eae002a5594bb7b900106a1 | [
"MIT"
] | 3 | 2020-05-18T06:34:52.000Z | 2020-07-17T07:11:57.000Z | pltools/train/module.py | PhoenixDL/PytorchLightningTools | 86185062d4792e6d5eae002a5594bb7b900106a1 | [
"MIT"
] | 6 | 2021-06-25T18:21:06.000Z | 2021-06-25T18:21:32.000Z | pltools/train/module.py | PhoenixDL/PytorchLightningTools | 86185062d4792e6d5eae002a5594bb7b900106a1 | [
"MIT"
] | 1 | 2020-05-18T06:34:56.000Z | 2020-05-18T06:34:56.000Z | from __future__ import annotations
import typing
transform_type = typing.Iterable[typing.Callable]
| 31.354839 | 72 | 0.590021 | from __future__ import annotations
import typing
import torch
from torch.utils.data import DataLoader
import pytorch_lightning as pl
from pltools.config import Config
transform_type = typing.Iterable[typing.Callable]
class Module(pl.LightningModule):
def __init__(self,
hparams: Config,
... | 0 | 740 | 0 | 1,958 | 0 | 921 | 0 | 30 | 135 |
5be2c7014a6a8285c9a8486e36cad38accdcfdce | 959 | py | Python | postprocessors.py | ahmetb/simplegauges | c5a1e809f4534f72c436141f3c506b252ebb6b40 | [
"Apache-2.0"
] | 2 | 2015-02-14T22:26:36.000Z | 2015-06-22T12:01:16.000Z | postprocessors.py | ahmetalpbalkan/simplegauges | c5a1e809f4534f72c436141f3c506b252ebb6b40 | [
"Apache-2.0"
] | null | null | null | postprocessors.py | ahmetalpbalkan/simplegauges | c5a1e809f4534f72c436141f3c506b252ebb6b40 | [
"Apache-2.0"
] | 1 | 2019-04-15T13:45:11.000Z | 2019-04-15T13:45:11.000Z | # coding: utf-8
def day_fill(data, fill_value=None):
"""Given a data set with missing day values sorted by day, adds records
with value of `fill_value`
"""
return generic_day_fill(1, data, fill_value)
def week_fill(data, fill_value=None):
"""Given a sorted data set with missing week keys, adds r... | 28.205882 | 75 | 0.630865 | # coding: utf-8
from datetime import timedelta
from helpers import make_record
def day_fill(data, fill_value=None):
"""Given a data set with missing day values sorted by day, adds records
with value of `fill_value`
"""
return generic_day_fill(1, data, fill_value)
def week_fill(data, fill_value=None... | 0 | 0 | 0 | 0 | 0 | 456 | 0 | 19 | 68 |
ac8a99e9b1eb5584ca24c2aca70dd9be5d5154e8 | 2,373 | py | Python | Examples/AppKit/FieldGraph/CGraphModel.py | Khan/pyobjc-framework-Cocoa | f8b015ea2a72d8d78be6084fb12925c4785b8f1f | [
"MIT"
] | 132 | 2015-01-01T10:02:42.000Z | 2022-03-09T12:51:01.000Z | mac/pyobjc-framework-Cocoa/Examples/AppKit/FieldGraph/CGraphModel.py | mba811/music-player | 7998986b34cfda2244ef622adefb839331b81a81 | [
"BSD-2-Clause"
] | 6 | 2015-01-06T08:23:19.000Z | 2019-03-14T12:22:06.000Z | mac/pyobjc-framework-Cocoa/Examples/AppKit/FieldGraph/CGraphModel.py | mba811/music-player | 7998986b34cfda2244ef622adefb839331b81a81 | [
"BSD-2-Clause"
] | 27 | 2015-02-23T11:51:43.000Z | 2022-03-07T02:34:18.000Z |
#____________________________________________________________
| 28.939024 | 122 | 0.572693 | from Foundation import NSObject
from objc import *
from AppKit import NSBezierPath
from fieldMath import *
#____________________________________________________________
class CGraphModel(NSObject):
def init(self):
self.field = [1.0, 1.12, 0.567]
self.phase = [degToRad(0), degToRad(152.6), degToRa... | 0 | 0 | 0 | 2,180 | 0 | 0 | 0 | 19 | 111 |
e8a306946d3872aaea3b9a534d70503e4797fe01 | 1,549 | py | Python | opticspy/ray_tracing/tests/test1_spotdiagram.py | benJephunneh/opticspy | a0b841f60f7c053b05444c0e8886cd4a99c4d082 | [
"MIT"
] | null | null | null | opticspy/ray_tracing/tests/test1_spotdiagram.py | benJephunneh/opticspy | a0b841f60f7c053b05444c0e8886cd4a99c4d082 | [
"MIT"
] | null | null | null | opticspy/ray_tracing/tests/test1_spotdiagram.py | benJephunneh/opticspy | a0b841f60f7c053b05444c0e8886cd4a99c4d082 | [
"MIT"
] | null | null | null | from __future__ import division as division
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import field
import traceray
import surface
import cal_tools
# test ray.py and traceray.py
# define rays
l1 = np.linspace(-5,5,10)
Pos1 = []
for i in l1:
for j in l1:
if i**2+j**... | 19.123457 | 95 | 0.684312 | from __future__ import division as division
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import field
import traceray
import surface
import cal_tools
# test ray.py and traceray.py
# define rays
l1 = np.linspace(-5,5,10)
Pos1 = []
for i in l1:
for j in l1:
if i**2+j**... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |