hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c2e98b8bfffd32e002ee05aa4877b21658d72a4 | 59,466 | py | Python | azure-devops/azure/devops/released/build/build_client.py | imafidon2020/azure-devops-python-api | ea9075f0c54dbc10115a23a8b7ad34feacbbdc14 | [
"MIT"
] | 248 | 2019-05-10T14:20:24.000Z | 2022-03-29T12:17:27.000Z | azure-devops/azure/devops/released/build/build_client.py | AzureMentor/azure-devops-python-api | 3838e91d662dba1f77b43ad560ca23c1cb7e84e8 | [
"MIT"
] | 147 | 2019-05-08T14:20:49.000Z | 2022-03-28T19:36:21.000Z | azure-devops/azure/devops/released/build/build_client.py | AzureMentor/azure-devops-python-api | 3838e91d662dba1f77b43ad560ca23c1cb7e84e8 | [
"MIT"
] | 121 | 2019-05-08T06:24:39.000Z | 2022-03-01T12:58:02.000Z | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# -------------------------------------------------------------------... | 54.505958 | 411 | 0.618437 |
from msrest import Serializer, Deserializer
from ...client import Client
from ...v5_1.build import models
class BuildClient(Client):
"""Build
:param str base_url: Service URL
:param Authentication creds: Authenticated credentials.
"""
def __init__(self, base_url=None, creds=None):
... | false | true |
1c2e98c5d3a6ae7e454bd0a11c1fd19a668d87f1 | 727 | py | Python | 0-python-tutorial/15-whileLoops01.py | luis2ra/py3-00-w3schools | 6bb851837f8ef9520491d13fa2c909047c9b18cf | [
"MIT"
] | null | null | null | 0-python-tutorial/15-whileLoops01.py | luis2ra/py3-00-w3schools | 6bb851837f8ef9520491d13fa2c909047c9b18cf | [
"MIT"
] | null | null | null | 0-python-tutorial/15-whileLoops01.py | luis2ra/py3-00-w3schools | 6bb851837f8ef9520491d13fa2c909047c9b18cf | [
"MIT"
] | null | null | null | # Demo Python While Loops - The while Loop
'''
Python Loops
Python has two primitive loop commands:
* while loops
* for loops
The while Loop
With the while loop we can execute a set of statements as long as a condition is true.
The break Statement
With the break statement we can stop the loop even if the while co... | 24.233333 | 93 | 0.742779 |
i = 1
while i < 6:
print(i)
i += 1
| true | true |
1c2e98dcd2881dc76511ceaa21ca33c13ae38a75 | 466 | py | Python | test_amadeus_rest.py | gozayaan/pyamadeus | 0c68eb517ce3ed3c4329becfed28c20df031f3a8 | [
"Apache-2.0"
] | 3 | 2019-05-15T06:54:44.000Z | 2020-10-31T04:43:32.000Z | test_amadeus_rest.py | gozayaan/pyamadeus | 0c68eb517ce3ed3c4329becfed28c20df031f3a8 | [
"Apache-2.0"
] | 4 | 2019-10-27T19:27:50.000Z | 2021-12-13T19:47:01.000Z | test_amadeus_rest.py | gozayaan/pyamadeus | 0c68eb517ce3ed3c4329becfed28c20df031f3a8 | [
"Apache-2.0"
] | 2 | 2018-08-04T14:32:52.000Z | 2021-01-19T08:26:22.000Z | #!/usr/bin/env python
from amadeus import Flights
from constants import *
import sys
if __name__ == "__main__":
if len(API_KEY) == 0:
raise Exception("Obtain an API key from sandbox.amadeus.com and store it in constants.py")
sys.exit()
print "Flight search:"
flights = Flights(API_KEY)
... | 23.3 | 98 | 0.652361 |
from amadeus import Flights
from constants import *
import sys
if __name__ == "__main__":
if len(API_KEY) == 0:
raise Exception("Obtain an API key from sandbox.amadeus.com and store it in constants.py")
sys.exit()
print "Flight search:"
flights = Flights(API_KEY)
resp = flights.insp... | false | true |
1c2e99db2cbdc57411192ee318f4c65aebf235e1 | 6,367 | py | Python | Projects/Automatic Sentiment Analysis/sentiment_analysis/main.py | livanshu/Data_Science_Portfolio | 18a912bab7383f55dece5ffcbfb2cff546ffe55e | [
"MIT"
] | null | null | null | Projects/Automatic Sentiment Analysis/sentiment_analysis/main.py | livanshu/Data_Science_Portfolio | 18a912bab7383f55dece5ffcbfb2cff546ffe55e | [
"MIT"
] | null | null | null | Projects/Automatic Sentiment Analysis/sentiment_analysis/main.py | livanshu/Data_Science_Portfolio | 18a912bab7383f55dece5ffcbfb2cff546ffe55e | [
"MIT"
] | null | null | null | import project1 as p1
import utils
import numpy as np
#-------------------------------------------------------------------------------
# Data loading. There is no need to edit code in this section.
#-------------------------------------------------------------------------------
train_data = utils.load_data('r... | 49.356589 | 115 | 0.621957 | import project1 as p1
import utils
import numpy as np
train_data = utils.load_data('reviews_train.tsv')
val_data = utils.load_data('reviews_val.tsv')
test_data = utils.load_data('reviews_test.tsv')
train_texts, train_labels = zip(*((sample['text'], sample['sentiment']) for sample in train_data))
val_tex... | false | true |
1c2e9b907048749d4a615844f89a74dedb32a1ae | 2,412 | py | Python | autoimpute/analysis/metrics.py | gjdv/autoimpute | aa418102d3b64fc7e0c0dafa6839746f0b9a6545 | [
"MIT"
] | 191 | 2019-03-16T17:00:33.000Z | 2022-03-11T12:14:17.000Z | autoimpute/analysis/metrics.py | MlataIbrahim/autoimpute | d22cd86db6facd4a68746c8c0fcb3fae70071dac | [
"MIT"
] | 57 | 2019-03-09T23:59:38.000Z | 2022-03-01T08:17:33.000Z | autoimpute/analysis/metrics.py | MlataIbrahim/autoimpute | d22cd86db6facd4a68746c8c0fcb3fae70071dac | [
"MIT"
] | 19 | 2019-04-13T19:01:23.000Z | 2021-05-14T08:59:27.000Z | """This module devises metrics to compare estimates from analysis models."""
import numpy as np
import pandas as pd
def raw_bias(Q_bar, Q):
"""Calculate raw bias between coefficients Q and actual Q.
Q_bar can be one estimate (scalar) or a vector of estimates. This equation
subtracts the expected Q_bar fr... | 30.531646 | 78 | 0.65796 |
import numpy as np
import pandas as pd
def raw_bias(Q_bar, Q):
shape_err = "Q_bar & Q must be scalars or vectors of same length."
if isinstance(Q_bar, pd.DataFrame):
s = len(Q_bar.shape)
if s != 1:
raise ValueError(shape_err)
if isinstance(Q, pd.DataFrame):
s = l... | true | true |
1c2e9bcf8eeceddc793d357ac20131bc4c084d2d | 2,020 | py | Python | download_and_clean_data_scripts/pixabay/pixabay_main_custom.py | NMag-ze/Colorization | 1c91fb69d3505de6cd746dab3ddc15a704aa028a | [
"MIT"
] | null | null | null | download_and_clean_data_scripts/pixabay/pixabay_main_custom.py | NMag-ze/Colorization | 1c91fb69d3505de6cd746dab3ddc15a704aa028a | [
"MIT"
] | null | null | null | download_and_clean_data_scripts/pixabay/pixabay_main_custom.py | NMag-ze/Colorization | 1c91fb69d3505de6cd746dab3ddc15a704aa028a | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# @Time : 2018/8/16 10:59
# @Author : 陈子昂
import os
import requests
from bs4 import BeautifulSoup
from tqdm import tqdm
import sys
from utils import save_img, path_processor, img_name_processor
def pexels(keyword):
img_cnt = 0
if not keyword: sys.exit('程序退出:未输入关键字!')
for page i... | 42.978723 | 588 | 0.587624 |
import os
import requests
from bs4 import BeautifulSoup
from tqdm import tqdm
import sys
from utils import save_img, path_processor, img_name_processor
def pexels(keyword):
img_cnt = 0
if not keyword: sys.exit('程序退出:未输入关键字!')
for page in tqdm(range(1, 50)):
print(f'\n-----[{keyword}]正在爬取第{page}... | true | true |
1c2e9bd62250529bf5b8c71a6f78cdc41dea29c9 | 1,568 | py | Python | stats_scripts/data_management/validate_consistancy.py | LilithHafner/SymbulationEmp | fb53c7fbefa03f6d901cdd49bdb823a637449bba | [
"MIT"
] | null | null | null | stats_scripts/data_management/validate_consistancy.py | LilithHafner/SymbulationEmp | fb53c7fbefa03f6d901cdd49bdb823a637449bba | [
"MIT"
] | null | null | null | stats_scripts/data_management/validate_consistancy.py | LilithHafner/SymbulationEmp | fb53c7fbefa03f6d901cdd49bdb823a637449bba | [
"MIT"
] | null | null | null | lines = open('collated_data.data').readlines()
header = [x.strip('"') for x in lines[0].split()]
independent_variables = 'HRR', 'HRR', 'SLR', 'BS', 'BT', 'SL', 'SYN', 'POP', 'UPS', 'T'
dependant_variables = 'host_count', 'sym_count', 'survival', 'moi'
omit = ('file_name',)
versions = '"Standard-1.1"', '"Duplicate-1.1... | 35.636364 | 100 | 0.58801 | lines = open('collated_data.data').readlines()
header = [x.strip('"') for x in lines[0].split()]
independent_variables = 'HRR', 'HRR', 'SLR', 'BS', 'BT', 'SL', 'SYN', 'POP', 'UPS', 'T'
dependant_variables = 'host_count', 'sym_count', 'survival', 'moi'
omit = ('file_name',)
versions = '"Standard-1.1"', '"Duplicate-1.1... | true | true |
1c2e9ca1193e20f92c9e20e10de63accebbd6262 | 1,642 | py | Python | laikaboss/modules/meta_iqy.py | sandialabs/laikaboss | 3064ac1176911651d61c5176e9bd83eacec36b16 | [
"Apache-2.0"
] | 2 | 2019-11-02T23:40:23.000Z | 2019-12-01T22:24:57.000Z | laikaboss/modules/meta_iqy.py | sandialabs/laikaboss | 3064ac1176911651d61c5176e9bd83eacec36b16 | [
"Apache-2.0"
] | null | null | null | laikaboss/modules/meta_iqy.py | sandialabs/laikaboss | 3064ac1176911651d61c5176e9bd83eacec36b16 | [
"Apache-2.0"
] | 3 | 2017-08-09T23:58:40.000Z | 2019-12-01T22:25:06.000Z | # Copyright 2020 National Technology & Engineering Solutions of Sandia, LLC
# (NTESS). Under the terms of Contract DE-NA0003525 with NTESS, the U.S.
# Government retains certain rights in this software.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in complianc... | 35.695652 | 76 | 0.696711 |
from laikaboss.si_module import SI_MODULE
class META_IQY(SI_MODULE):
def __init__(self):
self.module_name = "META_IQY"
def _run(self, scanObject, result, depth, args):
s = scanObject.buffer
index_one = s.index(b"1")
newline = b'\n'
url = s[index_o... | true | true |
1c2e9cc4b9a651b57cc3b5e361842704cab3a988 | 11,924 | py | Python | docs/doxygen/swig_doc.py | hb9fxq/gr-aaronia_rtsa | ac66cc0630668b70fddc393735e6034ccd1cf40a | [
"MIT"
] | null | null | null | docs/doxygen/swig_doc.py | hb9fxq/gr-aaronia_rtsa | ac66cc0630668b70fddc393735e6034ccd1cf40a | [
"MIT"
] | null | null | null | docs/doxygen/swig_doc.py | hb9fxq/gr-aaronia_rtsa | ac66cc0630668b70fddc393735e6034ccd1cf40a | [
"MIT"
] | null | null | null | #
# Copyright 2010-2012 Free Software Foundation, Inc.
#
# This file was generated by gr_modtool, a tool from the GNU Radio framework
# This file is a part of gr-aaronia_rtsa
#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# th... | 35.807808 | 102 | 0.666555 |
from __future__ import unicode_literals
import sys, time
from doxyxml import DoxyIndex, DoxyClass, DoxyFriend, DoxyFunction, DoxyFile
from doxyxml import DoxyOther, base
def py_name(name):
bits = name.split('_')
return '_'.join(bits[1:])
def make_name(name):
bits = name.split('_')
... | true | true |
1c2e9da8b1410e0876c772e4e9d83e5a0a64b024 | 436 | py | Python | src/dendrograms/dendrogram.py | Ellon-M/visualizations | 5a42c213ea8fd0597e2035778d9ae6460eb9e821 | [
"MIT"
] | null | null | null | src/dendrograms/dendrogram.py | Ellon-M/visualizations | 5a42c213ea8fd0597e2035778d9ae6460eb9e821 | [
"MIT"
] | null | null | null | src/dendrograms/dendrogram.py | Ellon-M/visualizations | 5a42c213ea8fd0597e2035778d9ae6460eb9e821 | [
"MIT"
] | null | null | null | # dendrogram
import scipy.cluster.hierarchy as shc
# Import Data
df = pd.read_csv('https://raw.githubusercontent.com/selva86/datasets/master/USArrests.csv')
# Plot
plt.figure(figsize=(16, 10), dpi= 80)
plt.title("USArrests Dendograms", fontsize=22)
dend = shc.dendrogram(shc.linkage(df[['Murder', 'Assault', 'Urb... | 29.066667 | 143 | 0.729358 |
import scipy.cluster.hierarchy as shc
df = pd.read_csv('https://raw.githubusercontent.com/selva86/datasets/master/USArrests.csv')
plt.figure(figsize=(16, 10), dpi= 80)
plt.title("USArrests Dendograms", fontsize=22)
dend = shc.dendrogram(shc.linkage(df[['Murder', 'Assault', 'UrbanPop', 'Rape']], method='ward'... | true | true |
1c2e9f75bc7f7bb8f373ef0d4b1ceb3207725ff7 | 1,967 | py | Python | .history/main_20171106224753.py | reecebenson/DADSA-Tennis-PartA | d0763f819b300fcd0ce27041f5bc4ef0519c00bf | [
"MIT"
] | null | null | null | .history/main_20171106224753.py | reecebenson/DADSA-Tennis-PartA | d0763f819b300fcd0ce27041f5bc4ef0519c00bf | [
"MIT"
] | null | null | null | .history/main_20171106224753.py | reecebenson/DADSA-Tennis-PartA | d0763f819b300fcd0ce27041f5bc4ef0519c00bf | [
"MIT"
] | null | null | null | # DADSA - Assignment 1
# Reece Benson
from classes import Menu as Menu
from classes import Handler as Handler
class App():
# Define the variables we will be using
debug = True
handler = None
# Define all of the properties we will need to use
def __init__(self):
# Load our handler
... | 31.725806 | 83 | 0.543467 |
from classes import Menu as Menu
from classes import Handler as Handler
class App():
debug = True
handler = None
def __init__(self):
self.handler = Handler.Handler(self)
self.handler.load()
self.generate_rounds()
self.exit()
... | true | true |
1c2e9fe71d358bad524ca7f4ba082ca2127b186a | 2,471 | py | Python | lib/reda/importers/geotom.py | j-gallistl/reda | 13b1f9e1cda92bbbbafc5c28be2c691d3b722740 | [
"MIT"
] | 12 | 2017-12-11T08:32:46.000Z | 2021-06-09T05:41:57.000Z | lib/reda/importers/geotom.py | j-gallistl/reda | 13b1f9e1cda92bbbbafc5c28be2c691d3b722740 | [
"MIT"
] | 58 | 2017-11-12T11:10:42.000Z | 2021-06-11T13:52:44.000Z | lib/reda/importers/geotom.py | geophysics-ubonn/REDA | 8f0399031121f5a937171231a25f9ab03a3c8873 | [
"MIT"
] | 11 | 2017-11-12T12:02:35.000Z | 2021-02-16T06:54:04.000Z | # -*- coding: utf-8 -*-
from io import StringIO
import pandas as pd
import numpy as np
from reda.containers.ERT import ERT
from reda.importers.utils.decorators import enable_result_transforms
@enable_result_transforms
def _parse_wenner_file(filename, settings):
"""Parse a Geotom .wen (Wenner configuration) file... | 22.463636 | 79 | 0.541076 |
from io import StringIO
import pandas as pd
import numpy as np
from reda.containers.ERT import ERT
from reda.importers.utils.decorators import enable_result_transforms
@enable_result_transforms
def _parse_wenner_file(filename, settings):
with open(filename, 'r') as fid2:
geotom_data_orig = fid2.re... | true | true |
1c2ea03e03b381cfed1b2a2fb9de2e155e4a83d4 | 3,527 | py | Python | tests/test_unicode_strings.py | alekseyl1992/pyrobuf | dc553f2c407d3ea1ca78c6b58e149d05ff811a23 | [
"Apache-2.0"
] | 578 | 2015-12-17T20:39:31.000Z | 2022-02-15T05:14:03.000Z | tests/test_unicode_strings.py | alekseyl1992/pyrobuf | dc553f2c407d3ea1ca78c6b58e149d05ff811a23 | [
"Apache-2.0"
] | 121 | 2015-12-19T07:37:32.000Z | 2022-02-22T05:22:55.000Z | tests/test_unicode_strings.py | alekseyl1992/pyrobuf | dc553f2c407d3ea1ca78c6b58e149d05ff811a23 | [
"Apache-2.0"
] | 82 | 2015-12-19T00:19:28.000Z | 2022-02-21T09:00:21.000Z | import unittest
Test = None
TestSs1 = None
# Alpha, Beta, Gamma, Delta
GREEK_LETTERS = u"\u0391\u0392\u0393\u0394"
class TestUnicodeStrings(unittest.TestCase):
@classmethod
def setUpClass(cls):
global Test, TestSs1, TestFieldTypes
from test_message_proto import Test, TestSs1
def test_un... | 43.012195 | 108 | 0.686703 | import unittest
Test = None
TestSs1 = None
GREEK_LETTERS = u"\u0391\u0392\u0393\u0394"
class TestUnicodeStrings(unittest.TestCase):
@classmethod
def setUpClass(cls):
global Test, TestSs1, TestFieldTypes
from test_message_proto import Test, TestSs1
def test_unicode_string_parse_from_str... | true | true |
1c2ea062620b72b16560fe0603e880b6ea79c7f0 | 271 | py | Python | buoi7/bai12.py | Viet7501/viet1 | e0be1da1fb0f4736c8d0457733ccaaed9232c4e9 | [
"Apache-2.0"
] | null | null | null | buoi7/bai12.py | Viet7501/viet1 | e0be1da1fb0f4736c8d0457733ccaaed9232c4e9 | [
"Apache-2.0"
] | null | null | null | buoi7/bai12.py | Viet7501/viet1 | e0be1da1fb0f4736c8d0457733ccaaed9232c4e9 | [
"Apache-2.0"
] | null | null | null | set1 = {0, 1, 2, 3, 4, 5, 6}
set2 = {5, 6, 7, 8, 9, 0, 1}
# set1.difference_update(set2)
# set1.intersection_update(set2)
print(set1.issubset(set2))
print(set1.isdisjoint(set2))
print(set1.issuperset(set2))
set1.symmetric_difference_update(set2)
print(set1)
| 22.583333 | 39 | 0.682657 | set1 = {0, 1, 2, 3, 4, 5, 6}
set2 = {5, 6, 7, 8, 9, 0, 1}
print(set1.issubset(set2))
print(set1.isdisjoint(set2))
print(set1.issuperset(set2))
set1.symmetric_difference_update(set2)
print(set1)
| true | true |
1c2ea0d7071e64a32dcaa6aa1f4226fc529ca0a6 | 9,426 | py | Python | saleor/payment/gateway.py | facundon/Cholitas-Backend | 4d73e0697a6b6fc61b82b72ff1c99b2eabe8f4c6 | [
"CC-BY-4.0"
] | null | null | null | saleor/payment/gateway.py | facundon/Cholitas-Backend | 4d73e0697a6b6fc61b82b72ff1c99b2eabe8f4c6 | [
"CC-BY-4.0"
] | null | null | null | saleor/payment/gateway.py | facundon/Cholitas-Backend | 4d73e0697a6b6fc61b82b72ff1c99b2eabe8f4c6 | [
"CC-BY-4.0"
] | null | null | null | import logging
from decimal import Decimal
from typing import TYPE_CHECKING, Callable, List, Optional
from django.db import transaction
from ..payment.interface import TokenConfig
from ..plugins.manager import get_plugins_manager
from . import GatewayError, PaymentError, TransactionKind
from .models import Payment, T... | 32.729167 | 87 | 0.736474 | import logging
from decimal import Decimal
from typing import TYPE_CHECKING, Callable, List, Optional
from django.db import transaction
from ..payment.interface import TokenConfig
from ..plugins.manager import get_plugins_manager
from . import GatewayError, PaymentError, TransactionKind
from .models import Payment, T... | true | true |
1c2ea26a0e074c408ad814c5bbffa80acfedad47 | 1,230 | py | Python | tests/unit/objects/test_list_objects.py | dlite-tools/aws-s3-tools | f434ed36c1fc0530f2be6b52808cbc5e59ea8990 | [
"MIT"
] | 6 | 2021-02-18T10:03:17.000Z | 2022-01-14T06:11:54.000Z | tests/unit/objects/test_list.py | FerrariDG/aws-s3-tools | 0ddbb35cebc858bae1a0627aa8726e063a3ef5cd | [
"MIT"
] | 4 | 2021-04-20T18:20:32.000Z | 2022-02-04T08:32:39.000Z | tests/unit/objects/test_list_objects.py | dlite-tools/aws-s3-tools | f434ed36c1fc0530f2be6b52808cbc5e59ea8990 | [
"MIT"
] | 2 | 2021-03-04T00:25:51.000Z | 2021-05-10T13:20:42.000Z | """Unit tests for list.py"""
from botocore.exceptions import ClientError
from s3_tools import list_objects
from tests.unit.conftest import (
create_bucket,
BUCKET_NAME,
FILENAME
)
class TestList:
def test_list_nonexisting_bucket(self, s3_client):
try:
list_objects(BUCKET_NAME)
... | 27.333333 | 69 | 0.647154 | from botocore.exceptions import ClientError
from s3_tools import list_objects
from tests.unit.conftest import (
create_bucket,
BUCKET_NAME,
FILENAME
)
class TestList:
def test_list_nonexisting_bucket(self, s3_client):
try:
list_objects(BUCKET_NAME)
except ClientError as ... | true | true |
1c2ea307dfc71029b6d922a7886d6cfe21a1e7e4 | 5,215 | py | Python | tests/common/test_run/ascend/matmul_addn_transdata_run.py | tianjiashuo/akg | a9cbf642063fb1086a93e8bc6be6feb145689817 | [
"Apache-2.0"
] | 286 | 2020-06-23T06:40:44.000Z | 2022-03-30T01:27:49.000Z | tests/common/test_run/ascend/matmul_addn_transdata_run.py | tianjiashuo/akg | a9cbf642063fb1086a93e8bc6be6feb145689817 | [
"Apache-2.0"
] | 10 | 2020-07-31T03:26:59.000Z | 2021-12-27T15:00:54.000Z | tests/common/test_run/ascend/matmul_addn_transdata_run.py | tianjiashuo/akg | a9cbf642063fb1086a93e8bc6be6feb145689817 | [
"Apache-2.0"
] | 30 | 2020-07-17T01:04:14.000Z | 2021-12-27T14:05:19.000Z | # Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 48.287037 | 185 | 0.671333 |
import akg.tvm
import numpy as np
from akg.utils import kernel_exec as utils
from akg.ops.math.ascend import MatMul
from tests.common.test_run.ascend.matmul_run import *
from akg.ops.math import Addn
from akg.ops.math import Add
def matmul_addn_transdata(x, y, adds, b, out_dtype, left_format="zZ", right_... | true | true |
1c2ea4079c97b189152dc6aa48f65a7d6ac7d1f2 | 4,314 | py | Python | pipeline/In_situ/ZFIN/zebra_query.py | julien-roux/bgee_pipeline | 9c75b75308501c700a1a0c2bc2da2691f2d34805 | [
"CC0-1.0"
] | null | null | null | pipeline/In_situ/ZFIN/zebra_query.py | julien-roux/bgee_pipeline | 9c75b75308501c700a1a0c2bc2da2691f2d34805 | [
"CC0-1.0"
] | null | null | null | pipeline/In_situ/ZFIN/zebra_query.py | julien-roux/bgee_pipeline | 9c75b75308501c700a1a0c2bc2da2691f2d34805 | [
"CC0-1.0"
] | null | null | null | #!/usr/bin/env python
# This is an automatically generated script to run your query
# to use it you will require the intermine python client.
# To install the client, run the following command from a terminal:
#
# sudo easy_install intermine
#
# For further documentation you can visit:
# http://www.intermine.o... | 58.297297 | 513 | 0.738294 |
from intermine.webservice import Service
service = Service("http://zebrafishmine.org/service")
query = service.new_query("Gene")
query.add_view(
"primaryIdentifier", "expressions.expressionFound", "symbol",
"expressions.anatomy.name", "expressions.anatomy.identifier",
"expressions.startSt... | false | true |
1c2ea46aad078a13c077e1ce5e6d9d9417d6e2d3 | 815 | py | Python | gan/PyTorch-GAN-Mnist/test.py | hadleyhzy34/GANs-practice | 37d1dcf4e4b492e6d070b0ba72f320913af9b17a | [
"MIT"
] | null | null | null | gan/PyTorch-GAN-Mnist/test.py | hadleyhzy34/GANs-practice | 37d1dcf4e4b492e6d070b0ba72f320913af9b17a | [
"MIT"
] | null | null | null | gan/PyTorch-GAN-Mnist/test.py | hadleyhzy34/GANs-practice | 37d1dcf4e4b492e6d070b0ba72f320913af9b17a | [
"MIT"
] | null | null | null | import torch
from torchvision import transforms
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
plt.rcParams['figure.figsize'] = (10.0, 8.0)
plt.rcParams['image.interpolation'] = 'nearest'
plt.rcParams['image.cmap'] = 'gray'
def show_images(images):
sqrtn = int(np.ceil... | 21.447368 | 57 | 0.70184 | import torch
from torchvision import transforms
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
plt.rcParams['figure.figsize'] = (10.0, 8.0)
plt.rcParams['image.interpolation'] = 'nearest'
plt.rcParams['image.cmap'] = 'gray'
def show_images(images):
sqrtn = int(np.ceil... | true | true |
1c2ea46c2dbae491088472dec33c9b4319f71f78 | 8,389 | py | Python | src/m2_functions.py | ElliotBoutell/ObjectsFunctionsAndMethods | 2f022fc7dbca5a5ad3b90cdb280e59b1ef28dd93 | [
"MIT"
] | null | null | null | src/m2_functions.py | ElliotBoutell/ObjectsFunctionsAndMethods | 2f022fc7dbca5a5ad3b90cdb280e59b1ef28dd93 | [
"MIT"
] | null | null | null | src/m2_functions.py | ElliotBoutell/ObjectsFunctionsAndMethods | 2f022fc7dbca5a5ad3b90cdb280e59b1ef28dd93 | [
"MIT"
] | null | null | null | """
Practice DEFINING and CALLING
FUNCTIONS
Authors: David Mutchler, Dave Fisher, Valerie Galluzzi, Amanda Stouder,
their colleagues and Elliot Boutell.
"""
########################################################################
#
# Done: 1. PUT YOUR NAME IN THE ABOVE LINE and...
#
# Allow this file ... | 34.101626 | 93 | 0.561092 |
module, far below.)
#
# ** ASK QUESTIONS if you are uncertain. **
#
# RELATE what is DRAWN to the CODE above. Be sure you understand:
# -- WHEN does the code in main run?
# -- WHEN does the code in turtle1 run?
# the code in turtle2 run?
# the code i... | true | true |
1c2ea51069614377d2b53c72c7b82fa4c473af18 | 3,559 | py | Python | anuvaad-etl/anuvaad-extractor/aligner/etl-aligner/kafkawrapper/alignmentwflowconsumer.py | ManavTriesStuff/anuvaad | 6993e3ac78818c171c173ccf8acf962ff57856a4 | [
"MIT"
] | 15 | 2021-01-08T08:42:30.000Z | 2022-03-12T17:52:15.000Z | anuvaad-etl/anuvaad-extractor/aligner/etl-aligner/kafkawrapper/alignmentwflowconsumer.py | ManavTriesStuff/anuvaad | 6993e3ac78818c171c173ccf8acf962ff57856a4 | [
"MIT"
] | 16 | 2021-01-21T01:38:51.000Z | 2022-01-20T08:59:52.000Z | anuvaad-etl/anuvaad-extractor/aligner/etl-aligner/kafkawrapper/alignmentwflowconsumer.py | ManavTriesStuff/anuvaad | 6993e3ac78818c171c173ccf8acf962ff57856a4 | [
"MIT"
] | 25 | 2020-08-26T11:25:38.000Z | 2022-03-29T04:40:21.000Z | import json
import logging
import random
import string
import threading
from kafka import KafkaConsumer, TopicPartition
from service.alignmentservice import AlignmentService
from utilities.alignmentutils import AlignmentUtils
from logging.config import dictConfig
from configs.alignerconfig import kafka_bootstrap_serve... | 35.237624 | 125 | 0.540882 | import json
import logging
import random
import string
import threading
from kafka import KafkaConsumer, TopicPartition
from service.alignmentservice import AlignmentService
from utilities.alignmentutils import AlignmentUtils
from logging.config import dictConfig
from configs.alignerconfig import kafka_bootstrap_serve... | true | true |
1c2ea52c32488d1ead6f2d2517e097d076dc1c24 | 13,804 | py | Python | circuit.py | Diimu/circuitsimulator | 3a4aeaaa89b5e9bba1598736140e32b3ca1e0da4 | [
"MIT"
] | null | null | null | circuit.py | Diimu/circuitsimulator | 3a4aeaaa89b5e9bba1598736140e32b3ca1e0da4 | [
"MIT"
] | 3 | 2019-09-08T18:34:27.000Z | 2019-09-08T21:51:18.000Z | circuit.py | Diimu/circuitsimulator | 3a4aeaaa89b5e9bba1598736140e32b3ca1e0da4 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Class "Circuit" defines simple one port object/circuit having
frequency (single point or array), impedance, and possibly a list
of components that constitute the circuit.
"""
import numpy as np
import scipy
import matplotlib.pyplot as plt
import skrf
class Circuit:
def __init__(s... | 41.083333 | 262 | 0.562808 |
import numpy as np
import scipy
import matplotlib.pyplot as plt
import skrf
class Circuit:
def __init__(self, f, Z, Z0=50, draw_smith=True):
self.Z = Z
self.f = f
self.Z0 = Z0
self.draw_smith=draw_smith
self.components = [('start', Z)]
if np.size(se... | true | true |
1c2ea563c1498911db332ccc6f834146e3a96988 | 105,906 | py | Python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_network_watchers_operations.py | praveenkuttappan/azure-sdk-for-python | 4b79413667b7539750a6c7dde15737013a3d4bd5 | [
"MIT"
] | 2,728 | 2015-01-09T10:19:32.000Z | 2022-03-31T14:50:33.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_network_watchers_operations.py | v-xuto/azure-sdk-for-python | 9c6296d22094c5ede410bc83749e8df8694ccacc | [
"MIT"
] | 17,773 | 2015-01-05T15:57:17.000Z | 2022-03-31T23:50:25.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_network_watchers_operations.py | v-xuto/azure-sdk-for-python | 9c6296d22094c5ede410bc83749e8df8694ccacc | [
"MIT"
] | 1,916 | 2015-01-19T05:05:41.000Z | 2022-03-31T19:36:44.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 53.541962 | 250 | 0.686288 |
from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union
import warnings
from azure.core.async_paging import AsyncItemPaged, AsyncList
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.... | true | true |
1c2ea56f126d1754020d9b2394105da6f3ce0700 | 7,580 | py | Python | sleepy/http.py | HitSyr/Sleepy | 70ec9479fb947a624e3c658ea39c886c30bf794d | [
"MIT"
] | 4 | 2021-12-08T21:38:14.000Z | 2022-01-30T04:16:38.000Z | sleepy/http.py | HitSyr/Sleepy | 70ec9479fb947a624e3c658ea39c886c30bf794d | [
"MIT"
] | 2 | 2021-09-29T13:33:26.000Z | 2021-12-12T12:52:16.000Z | sleepy/http.py | HitSyr/Sleepy | 70ec9479fb947a624e3c658ea39c886c30bf794d | [
"MIT"
] | null | null | null | """
Copyright (c) 2018-present HitchedSyringe
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at https://mozilla.org/MPL/2.0/.
"""
from __future__ import annotations
__all__ = (
"HTTPRequester",
... | 29.84252 | 94 | 0.596042 |
from __future__ import annotations
__all__ = (
"HTTPRequester",
"HTTPRequestFailed",
)
import asyncio
import logging
from collections.abc import MutableMapping
from typing import TYPE_CHECKING, Any, Dict, Optional, Tuple, Union
import aiohttp
from discord.ext import commands
_LOG = logging.getLogger(__... | true | true |
1c2ea76b9cf021143d713f6a07b53b3b5319c5e6 | 3,425 | py | Python | server.py | umran23/2_Threaded_server | eed32916ae645419c9634f7f6f4994300fe3feef | [
"Apache-2.0"
] | null | null | null | server.py | umran23/2_Threaded_server | eed32916ae645419c9634f7f6f4994300fe3feef | [
"Apache-2.0"
] | null | null | null | server.py | umran23/2_Threaded_server | eed32916ae645419c9634f7f6f4994300fe3feef | [
"Apache-2.0"
] | null | null | null | import socket
from threading import Thread
class Server:
addr = ''
port = 3030
connections = 4
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
self.logging('Socket has created')
self.... | 29.525862 | 76 | 0.52 | import socket
from threading import Thread
class Server:
addr = ''
port = 3030
connections = 4
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
self.logging('Socket has created')
self.... | true | true |
1c2ea7d11faf357ec52b98e2b099ef65b110baa3 | 4,548 | py | Python | temboo/core/Library/Twitter/Trends/Available.py | jordanemedlock/psychtruths | 52e09033ade9608bd5143129f8a1bfac22d634dd | [
"Apache-2.0"
] | 7 | 2016-03-07T02:07:21.000Z | 2022-01-21T02:22:41.000Z | temboo/core/Library/Twitter/Trends/Available.py | jordanemedlock/psychtruths | 52e09033ade9608bd5143129f8a1bfac22d634dd | [
"Apache-2.0"
] | null | null | null | temboo/core/Library/Twitter/Trends/Available.py | jordanemedlock/psychtruths | 52e09033ade9608bd5143129f8a1bfac22d634dd | [
"Apache-2.0"
] | 8 | 2016-06-14T06:01:11.000Z | 2020-04-22T09:21:44.000Z | # -*- coding: utf-8 -*-
###############################################################################
#
# Available
# Retrieves the locations that Twitter has trending topic information for.
#
# Python versions 2.6, 2.7, 3.x
#
# Copyright 2014, Temboo Inc.
#
# Licensed under the Apache License, Version 2.0 (the "Lic... | 40.247788 | 173 | 0.677661 | true | true | |
1c2ea7fb4024eb02de28a8b3543f21c6f2b00b6c | 67 | py | Python | tuiuiu/tuiuiutenant/__init__.py | caputomarcos/tuiuiu.io | d8fb57cf95487e7fe1454b2130ef18acc916da46 | [
"BSD-3-Clause"
] | 3 | 2019-08-08T09:09:35.000Z | 2020-12-15T18:04:17.000Z | tuiuiu/tuiuiutenant/__init__.py | caputomarcos/tuiuiu.io | d8fb57cf95487e7fe1454b2130ef18acc916da46 | [
"BSD-3-Clause"
] | null | null | null | tuiuiu/tuiuiutenant/__init__.py | caputomarcos/tuiuiu.io | d8fb57cf95487e7fe1454b2130ef18acc916da46 | [
"BSD-3-Clause"
] | 1 | 2017-09-09T20:10:40.000Z | 2017-09-09T20:10:40.000Z | default_app_config = 'tuiuiu.tuiuiutenant.apps.TuiuiuTenantConfig'
| 33.5 | 66 | 0.865672 | default_app_config = 'tuiuiu.tuiuiutenant.apps.TuiuiuTenantConfig'
| true | true |
1c2ea8d8d7ef40216683485021e310b67b3e922f | 1,963 | py | Python | genanki/deck.py | jahzielv/genanki | 6d173fcd8a50b29164d733fce750276bc9a9f39d | [
"MIT"
] | null | null | null | genanki/deck.py | jahzielv/genanki | 6d173fcd8a50b29164d733fce750276bc9a9f39d | [
"MIT"
] | null | null | null | genanki/deck.py | jahzielv/genanki | 6d173fcd8a50b29164d733fce750276bc9a9f39d | [
"MIT"
] | null | null | null | import json
from .apkg_col import APKG_COL
class Deck:
def __init__(self, deck_id=None, name=None):
self.deck_id = deck_id
self.name = name
self.notes = []
self.models = {} # map of model id to model
def add_note(self, note):
self.notes.append(note)
def add_model(self, model):
self.mo... | 32.716667 | 118 | 0.691798 | import json
from .apkg_col import APKG_COL
class Deck:
def __init__(self, deck_id=None, name=None):
self.deck_id = deck_id
self.name = name
self.notes = []
self.models = {}
def add_note(self, note):
self.notes.append(note)
def add_model(self, model):
self.models[model.model_id] = mod... | true | true |
1c2ea92a4a85689ac010f07469d5822e50872e06 | 9,408 | py | Python | nssrc/com/citrix/netscaler/nitro/resource/config/aaa/aaauser_authorizationpolicy_binding.py | guardicore/nitro-python | 5346a5086134aead80968f15a41ff527adaa0ec1 | [
"Apache-2.0"
] | null | null | null | nssrc/com/citrix/netscaler/nitro/resource/config/aaa/aaauser_authorizationpolicy_binding.py | guardicore/nitro-python | 5346a5086134aead80968f15a41ff527adaa0ec1 | [
"Apache-2.0"
] | null | null | null | nssrc/com/citrix/netscaler/nitro/resource/config/aaa/aaauser_authorizationpolicy_binding.py | guardicore/nitro-python | 5346a5086134aead80968f15a41ff527adaa0ec1 | [
"Apache-2.0"
] | null | null | null | #
# Copyright (c) 2021 Citrix Systems, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License")
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 32 | 322 | 0.737883 |
from nssrc.com.citrix.netscaler.nitro.resource.base.base_resource import base_resource
from nssrc.com.citrix.netscaler.nitro.resource.base.base_resource import base_response
from nssrc.com.citrix.netscaler.nitro.service.options import options
from nssrc.com.citrix.netscaler.nitro.exception.nitro_excepti... | true | true |
1c2ea92c956ad3a9d2609c38a046d8ef976c4efa | 4,139 | py | Python | benchmark/startQiskit_noisy954.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startQiskit_noisy954.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startQiskit_noisy954.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | # qubit number=5
# total number=45
import cirq
import qiskit
from qiskit.providers.aer import QasmSimulator
from qiskit.test.mock import FakeVigo
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister
from qiskit import BasicAer, execute, transpile
from pprint import pprint
from qiskit.test.mock import ... | 30.88806 | 82 | 0.60691 |
import cirq
import qiskit
from qiskit.providers.aer import QasmSimulator
from qiskit.test.mock import FakeVigo
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister
from qiskit import BasicAer, execute, transpile
from pprint import pprint
from qiskit.test.mock import FakeVigo
from math import log2,fl... | true | true |
1c2ea9c9fc370bfa92466b9a39561738eb589c91 | 1,175 | py | Python | calories_screen.py | RossinesP/pygamer_bike_game | 2b852126f1d04d6fc5e1053a3217862d86c7856d | [
"MIT"
] | null | null | null | calories_screen.py | RossinesP/pygamer_bike_game | 2b852126f1d04d6fc5e1053a3217862d86c7856d | [
"MIT"
] | null | null | null | calories_screen.py | RossinesP/pygamer_bike_game | 2b852126f1d04d6fc5e1053a3217862d86c7856d | [
"MIT"
] | null | null | null | from screen import Screen
from tracker import Tracker
from adafruit_display_text import label
import neopixel
import terminalio
class CaloriesScreen(Screen):
def __init__(self, screen_manager, pixels: neopixel.NeoPixel, tracker: Tracker):
super().__init__(screen_manager, pixels, tracker)
font = t... | 33.571429 | 84 | 0.670638 | from screen import Screen
from tracker import Tracker
from adafruit_display_text import label
import neopixel
import terminalio
class CaloriesScreen(Screen):
def __init__(self, screen_manager, pixels: neopixel.NeoPixel, tracker: Tracker):
super().__init__(screen_manager, pixels, tracker)
font = t... | true | true |
1c2eaa0ab91564a8c0e4fbb3f53ce5a5e680221a | 10,973 | py | Python | deeppavlov/tasks/insults/build.py | deepmipt/kpi2017 | 0f6b13c6ea76e544804ce66ba372c66d5ef9ee30 | [
"Apache-2.0"
] | 3 | 2018-02-19T15:34:44.000Z | 2018-06-05T10:02:00.000Z | deeppavlov/tasks/insults/build.py | deepmipt/kpi2017 | 0f6b13c6ea76e544804ce66ba372c66d5ef9ee30 | [
"Apache-2.0"
] | null | null | null | deeppavlov/tasks/insults/build.py | deepmipt/kpi2017 | 0f6b13c6ea76e544804ce66ba372c66d5ef9ee30 | [
"Apache-2.0"
] | 1 | 2021-03-22T09:06:52.000Z | 2021-03-22T09:06:52.000Z | # Copyright 2017 Neural Networks and Deep Learning lab, MIPT
#
# 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 applicab... | 38.773852 | 124 | 0.564385 |
import parlai.core.build_data as build_data
import os
import re
import string
import numpy as np
import pandas as pd
import urllib
def data_preprocessing(f):
f = [x.lower() for x in f]
f = [re.sub(r'^"|"$', '', x) for x in f]
f = [x.replace("\\n", " ") for x in f]
f = [x.replace("\\t", ... | true | true |
1c2eab47e8c5b4f21800af9cd5ed1e8c95cb0209 | 4,176 | py | Python | src/compas_assembly/datastructures/block.py | BlockResearchGroup/compas_assembly | 6a257e1afaf304f9ddad02baed2396e5bacf91f8 | [
"MIT"
] | 8 | 2019-01-30T18:08:07.000Z | 2021-06-25T09:35:01.000Z | src/compas_assembly/datastructures/block.py | BlockResearchGroup/compas_assembly | 6a257e1afaf304f9ddad02baed2396e5bacf91f8 | [
"MIT"
] | 6 | 2019-07-17T11:29:45.000Z | 2020-03-20T13:32:38.000Z | src/compas_assembly/datastructures/block.py | BlockResearchGroup/compas_assembly | 6a257e1afaf304f9ddad02baed2396e5bacf91f8 | [
"MIT"
] | 18 | 2019-01-29T09:02:40.000Z | 2021-12-09T09:52:25.000Z | from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
from compas.geometry import centroid_points
from compas.geometry import cross_vectors
from compas.geometry import dot_vectors
from compas.geometry import normalize_vector
from compas.geometry import centroid_po... | 28.216216 | 89 | 0.588362 | from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
from compas.geometry import centroid_points
from compas.geometry import cross_vectors
from compas.geometry import dot_vectors
from compas.geometry import normalize_vector
from compas.geometry import centroid_po... | true | true |
1c2eabd376142cf807c1e8d6a65fe520113a747a | 2,247 | py | Python | rbapi/apps/api/models.py | Yariquezz/check_gov_ua | 89d9a4d66ad5a675f64c8172de9d343b1024b102 | [
"Apache-2.0"
] | null | null | null | rbapi/apps/api/models.py | Yariquezz/check_gov_ua | 89d9a4d66ad5a675f64c8172de9d343b1024b102 | [
"Apache-2.0"
] | 9 | 2020-04-04T12:38:15.000Z | 2021-10-02T09:56:42.000Z | rbapi/apps/api/models.py | Yariquezz/check_gov_ua | 89d9a4d66ad5a675f64c8172de9d343b1024b102 | [
"Apache-2.0"
] | null | null | null | from django.db import models
import uuid
def get_default_uuid():
return uuid.uuid4().hex
class BankInfo(models.Model):
tax_code = models.IntegerField(primary_key=True)
bank_name = models.CharField(max_length=200, default=None, null=True)
support_number_1 = models.CharField(max_length=13, default=Non... | 34.569231 | 87 | 0.683133 | from django.db import models
import uuid
def get_default_uuid():
return uuid.uuid4().hex
class BankInfo(models.Model):
tax_code = models.IntegerField(primary_key=True)
bank_name = models.CharField(max_length=200, default=None, null=True)
support_number_1 = models.CharField(max_length=13, default=Non... | true | true |
1c2eabda09f4342028ede80cfd64ae89c9792eb2 | 2,844 | py | Python | apps/backend/users/views.py | 12roshan12/Hotel-website | 81c9ca74ea1f080c7fffb7cc350a39ccb2f2596f | [
"MIT"
] | null | null | null | apps/backend/users/views.py | 12roshan12/Hotel-website | 81c9ca74ea1f080c7fffb7cc350a39ccb2f2596f | [
"MIT"
] | null | null | null | apps/backend/users/views.py | 12roshan12/Hotel-website | 81c9ca74ea1f080c7fffb7cc350a39ccb2f2596f | [
"MIT"
] | null | null | null | from django.urls import reverse
from django.shortcuts import render, redirect, HttpResponseRedirect
from django.contrib.messages.views import SuccessMessageMixin
from django.utils.translation import templatize
from django.views.generic import CreateView, ListView, DeleteView, UpdateView
from .forms import EnquiryForm, ... | 32.689655 | 78 | 0.716245 | from django.urls import reverse
from django.shortcuts import render, redirect, HttpResponseRedirect
from django.contrib.messages.views import SuccessMessageMixin
from django.utils.translation import templatize
from django.views.generic import CreateView, ListView, DeleteView, UpdateView
from .forms import EnquiryForm, ... | true | true |
1c2eabe68bf4698868e90a9f2d54a2c3d20e6bd8 | 12,464 | py | Python | nonebot/matcher.py | Lancercmd/nonebot2 | 59d49becf49d108442c7ca05e4f3e2fb98c3a972 | [
"MIT"
] | null | null | null | nonebot/matcher.py | Lancercmd/nonebot2 | 59d49becf49d108442c7ca05e4f3e2fb98c3a972 | [
"MIT"
] | null | null | null | nonebot/matcher.py | Lancercmd/nonebot2 | 59d49becf49d108442c7ca05e4f3e2fb98c3a972 | [
"MIT"
] | null | null | null | """
事件响应器
==========
该模块实现事件响应器的创建与运行,并提供一些快捷方法来帮助用户更好的与机器人进行 对话 。
"""
from nonebot.log import logger
import typing
import inspect
from functools import wraps
from datetime import datetime
from contextvars import ContextVar
from collections import defaultdict
from nonebot.rule import Rule
from nonebot.permission imp... | 27.575221 | 106 | 0.522866 |
from nonebot.log import logger
import typing
import inspect
from functools import wraps
from datetime import datetime
from contextvars import ContextVar
from collections import defaultdict
from nonebot.rule import Rule
from nonebot.permission import Permission, USER
from nonebot.typing import Type, List, Dict, Union,... | true | true |
1c2eacfafb6429adc60a79646324136bfdb1e1d0 | 786 | py | Python | var/spack/repos/builtin/packages/py-lit/package.py | kkauder/spack | 6ae8d5c380c1f42094b05d38be26b03650aafb39 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2,360 | 2017-11-06T08:47:01.000Z | 2022-03-31T14:45:33.000Z | var/spack/repos/builtin/packages/py-lit/package.py | kkauder/spack | 6ae8d5c380c1f42094b05d38be26b03650aafb39 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 13,838 | 2017-11-04T07:49:45.000Z | 2022-03-31T23:38:39.000Z | var/spack/repos/builtin/packages/py-lit/package.py | kkauder/spack | 6ae8d5c380c1f42094b05d38be26b03650aafb39 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 1,793 | 2017-11-04T07:45:50.000Z | 2022-03-30T14:31:53.000Z | # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class PyLit(PythonPackage):
"""lit is a portable tool for executing LLVM and Clang style test su... | 37.428571 | 96 | 0.749364 |
from spack import *
class PyLit(PythonPackage):
pypi = "lit/lit-0.5.0.tar.gz"
version('0.7.1', sha256='ecef2833aef7f411cb923dac109c7c9dcc7dbe7cafce0650c1e8d19c243d955f')
version('0.5.0', sha256='3ea4251e78ebeb2e07be2feb33243d1f8931d956efc96ccc2b0846ced212b58c')
depends_on('py-setuptools', ty... | true | true |
1c2ead19859c5bebfcacdc7ae5358b7e31a8fe09 | 2,097 | py | Python | is_ros_pkg/examples/client.py | viniciusbaltoe/is-ros-pkg | e1ec6d5aa40d82b9259e406a1d6d196402e7a246 | [
"MIT"
] | null | null | null | is_ros_pkg/examples/client.py | viniciusbaltoe/is-ros-pkg | e1ec6d5aa40d82b9259e406a1d6d196402e7a246 | [
"MIT"
] | null | null | null | is_ros_pkg/examples/client.py | viniciusbaltoe/is-ros-pkg | e1ec6d5aa40d82b9259e406a1d6d196402e7a246 | [
"MIT"
] | null | null | null | from is_wire.core import Channel, Subscription, Message
from google.protobuf.empty_pb2 import Empty
from is_msgs.common_pb2 import Position
import json
import socket
import time
if __name__ == "__main__":
# -------------------------- Options -------------------------
cont = True
config_file = '../etc/conf/con... | 33.822581 | 71 | 0.592752 | from is_wire.core import Channel, Subscription, Message
from google.protobuf.empty_pb2 import Empty
from is_msgs.common_pb2 import Position
import json
import socket
import time
if __name__ == "__main__":
cont = True
config_file = '../etc/conf/config.json'
config = json.load(open(config_file, 'r'))
... | true | true |
1c2eadfcae187ab3eede7b128082e792f9694294 | 95 | py | Python | tests/__init__.py | rebornix/jedi-language-server | 13297ba1cc109c5f8c2e3b72a82ea79cc9711473 | [
"MIT"
] | 300 | 2019-08-20T14:00:37.000Z | 2022-03-31T00:10:25.000Z | tests/__init__.py | rebornix/jedi-language-server | 13297ba1cc109c5f8c2e3b72a82ea79cc9711473 | [
"MIT"
] | 136 | 2019-08-19T16:04:16.000Z | 2022-03-17T21:31:18.000Z | tests/__init__.py | rebornix/jedi-language-server | 13297ba1cc109c5f8c2e3b72a82ea79cc9711473 | [
"MIT"
] | 37 | 2020-05-03T14:20:51.000Z | 2022-03-23T06:12:22.000Z | """Testing entrypoint."""
import py
TEST_DATA = py.path.local(__file__) / ".." / "test_data"
| 15.833333 | 56 | 0.652632 |
import py
TEST_DATA = py.path.local(__file__) / ".." / "test_data"
| true | true |
1c2eaf20ba4549dae9aed8b51f3a802ab0cf1569 | 2,506 | py | Python | bigml/tests/inspect_model_steps.py | deven96/python | 46be8622fe58f004bdbd636a08a8904ef4134bcd | [
"Apache-2.0"
] | 1 | 2021-08-30T20:18:38.000Z | 2021-08-30T20:18:38.000Z | bigml/tests/inspect_model_steps.py | deven96/python | 46be8622fe58f004bdbd636a08a8904ef4134bcd | [
"Apache-2.0"
] | null | null | null | bigml/tests/inspect_model_steps.py | deven96/python | 46be8622fe58f004bdbd636a08a8904ef4134bcd | [
"Apache-2.0"
] | 1 | 2021-08-30T20:18:40.000Z | 2021-08-30T20:18:40.000Z | # -*- coding: utf-8 -*-
#!/usr/bin/env python
#
# Copyright 2012, 2015-2019 BigML
#
# 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... | 32.545455 | 75 | 0.735834 |
import io
import os
from bigml.tests.world import res_filename
from world import world
from nose.tools import eq_
def i_translate_the_tree_into_IF_THEN_rules(step):
output = io.BytesIO()
world.local_model.rules(out=output)
world.output = output.getvalue()
def i_check_the_data_distribut... | true | true |
1c2eaf3facbffed299455ef3e1efd26f63e89301 | 591 | py | Python | runners/fastwsgi_server.py | timb-machine-mirrors/pcf | d697a531da8c4206a6d874e689312a359446f8da | [
"MIT"
] | null | null | null | runners/fastwsgi_server.py | timb-machine-mirrors/pcf | d697a531da8c4206a6d874e689312a359446f8da | [
"MIT"
] | null | null | null | runners/fastwsgi_server.py | timb-machine-mirrors/pcf | d697a531da8c4206a6d874e689312a359446f8da | [
"MIT"
] | null | null | null | import fastwsgi
import app
def start_server():
host, port, debug, ssl_context = app.config_prepare()
def requires_authorization(f):
@wraps(f)
def decorated(*args, **kwargs):
if config['security']['basic_auth'] == '0':
return f(*args, **kwargs)
auth = re... | 28.142857 | 82 | 0.605753 | import fastwsgi
import app
def start_server():
host, port, debug, ssl_context = app.config_prepare()
def requires_authorization(f):
@wraps(f)
def decorated(*args, **kwargs):
if config['security']['basic_auth'] == '0':
return f(*args, **kwargs)
auth = re... | true | true |
1c2eaf46a4ed2fe9166ba288f3f111543133d5b3 | 10,128 | py | Python | workbench/deals/models.py | yoshson/workbench | 701558cac3357cd82e4dc99f0fefed12ee81ddc5 | [
"MIT"
] | 15 | 2020-09-02T22:17:34.000Z | 2022-02-01T20:09:10.000Z | workbench/deals/models.py | yoshson/workbench | 701558cac3357cd82e4dc99f0fefed12ee81ddc5 | [
"MIT"
] | 18 | 2020-01-08T15:28:26.000Z | 2022-02-28T02:46:41.000Z | workbench/deals/models.py | yoshson/workbench | 701558cac3357cd82e4dc99f0fefed12ee81ddc5 | [
"MIT"
] | 8 | 2020-09-29T08:00:24.000Z | 2022-01-16T11:58:19.000Z | import datetime as dt
from functools import total_ordering
from django.db import models
from django.db.models import Q
from django.utils import timezone
from django.utils.html import format_html
from django.utils.translation import gettext_lazy as _
from workbench.accounts.models import User
from workbench.contacts.m... | 30.053412 | 86 | 0.61957 | import datetime as dt
from functools import total_ordering
from django.db import models
from django.db.models import Q
from django.utils import timezone
from django.utils.html import format_html
from django.utils.translation import gettext_lazy as _
from workbench.accounts.models import User
from workbench.contacts.m... | true | true |
1c2eb04a1a9b3067e99eeca4aaa9170032411906 | 6,912 | py | Python | pyastar/astar.py | julesy89/pyastar | 8f063d55c9f88e1d1f3c6a08b652038abf33b90c | [
"Apache-2.0"
] | 3 | 2020-02-10T16:33:31.000Z | 2022-01-30T06:09:46.000Z | pyastar/astar.py | julesy89/pyastar | 8f063d55c9f88e1d1f3c6a08b652038abf33b90c | [
"Apache-2.0"
] | null | null | null | pyastar/astar.py | julesy89/pyastar | 8f063d55c9f88e1d1f3c6a08b652038abf33b90c | [
"Apache-2.0"
] | null | null | null | from pyastar.problem import Problem
from pyastar.util.node import NodeFactory
from pyastar.util.pq import PriorityQueueSet
class AStar:
def __init__(self,
problem,
heuristic_is_inconsistent=False,
open_set_max_size=None,
open_set_truncate_size=N... | 31.135135 | 105 | 0.584346 | from pyastar.problem import Problem
from pyastar.util.node import NodeFactory
from pyastar.util.pq import PriorityQueueSet
class AStar:
def __init__(self,
problem,
heuristic_is_inconsistent=False,
open_set_max_size=None,
open_set_truncate_size=N... | true | true |
1c2eb1241d77c82f23ac9ba30d8c63a85cb425c1 | 4,431 | py | Python | source/runbooks/ssm-py-scripts/start_secondary_ssm_automation_aurora_cluster.py | elduds/aws-instance-scheduler | 4b4c8a628fd0ab34e7d5c17af215f0bf10e48bd8 | [
"Apache-2.0"
] | 338 | 2018-02-09T17:24:26.000Z | 2021-10-06T01:33:52.000Z | source/runbooks/ssm-py-scripts/start_secondary_ssm_automation_aurora_cluster.py | elduds/aws-instance-scheduler | 4b4c8a628fd0ab34e7d5c17af215f0bf10e48bd8 | [
"Apache-2.0"
] | 267 | 2018-02-09T10:45:25.000Z | 2021-10-15T14:47:34.000Z | source/runbooks/ssm-py-scripts/start_secondary_ssm_automation_aurora_cluster.py | elduds/aws-instance-scheduler | 4b4c8a628fd0ab34e7d5c17af215f0bf10e48bd8 | [
"Apache-2.0"
] | 193 | 2018-02-14T08:25:30.000Z | 2021-10-06T14:59:14.000Z | ######################################################################################################################
# Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. #
# ... | 41.027778 | 118 | 0.488152 | true | true | |
1c2eb12c6402438db405004fbe1816c60fc14302 | 969 | py | Python | MSKHackMAG/api.py | kelbin/MCHProject2021Mosru | 3acf7bef228da7a42a1f2ae42562d4ac98a53acb | [
"MIT"
] | null | null | null | MSKHackMAG/api.py | kelbin/MCHProject2021Mosru | 3acf7bef228da7a42a1f2ae42562d4ac98a53acb | [
"MIT"
] | null | null | null | MSKHackMAG/api.py | kelbin/MCHProject2021Mosru | 3acf7bef228da7a42a1f2ae42562d4ac98a53acb | [
"MIT"
] | 1 | 2021-06-13T23:33:51.000Z | 2021-06-13T23:33:51.000Z | from afisha import get_afisha
from analytic import write_like, calculate_recomendation
from result import Result
import json
def get_feed():
r = get_afisha()
return r
def send_like(data):
userId = data["userId"]
afishaId = data["afishaId"]
result = write_like(userId, afishaId, 1)
return res... | 22.534884 | 61 | 0.668731 | from afisha import get_afisha
from analytic import write_like, calculate_recomendation
from result import Result
import json
def get_feed():
r = get_afisha()
return r
def send_like(data):
userId = data["userId"]
afishaId = data["afishaId"]
result = write_like(userId, afishaId, 1)
return res... | true | true |
1c2eb33b28bbe6a77f7479bf5efcdd305388856e | 539 | py | Python | flame/core/model/model_wrapper.py | v-tronglh/flamev2 | 7f376e8fbcfb592e0ad6f72fdaad0af5f2cf9231 | [
"MIT"
] | 3 | 2021-08-05T15:42:05.000Z | 2022-03-17T08:56:58.000Z | flame/core/model/model_wrapper.py | v-tronglh/flamev2 | 7f376e8fbcfb592e0ad6f72fdaad0af5f2cf9231 | [
"MIT"
] | null | null | null | flame/core/model/model_wrapper.py | v-tronglh/flamev2 | 7f376e8fbcfb592e0ad6f72fdaad0af5f2cf9231 | [
"MIT"
] | null | null | null | from typing import Any, Callable
from torch.nn import Module
class ModelWrapper:
def __init__(
self,
model: Module,
input_transform: Callable = lambda x: x,
):
super(ModelWrapper, self).__init__()
self.model = model
self.input_transform = input_transform
d... | 23.434783 | 48 | 0.621521 | from typing import Any, Callable
from torch.nn import Module
class ModelWrapper:
def __init__(
self,
model: Module,
input_transform: Callable = lambda x: x,
):
super(ModelWrapper, self).__init__()
self.model = model
self.input_transform = input_transform
d... | true | true |
1c2eb363382ba5f5dcee9f8740c9c3dcf0ae5183 | 362 | py | Python | idact/detail/log/set_paramiko_log_level.py | intdata-bsc/idact | 54cb65a711c145351e205970c27c83e6393cccf5 | [
"MIT"
] | 5 | 2018-12-06T15:40:34.000Z | 2019-06-19T11:22:58.000Z | idact/detail/log/set_paramiko_log_level.py | garstka/idact | b9c8405c94db362c4a51d6bfdf418b14f06f0da1 | [
"MIT"
] | 9 | 2018-12-06T16:35:26.000Z | 2019-04-28T19:01:40.000Z | idact/detail/log/set_paramiko_log_level.py | intdata-bsc/idact | 54cb65a711c145351e205970c27c83e6393cccf5 | [
"MIT"
] | 2 | 2019-04-28T19:18:58.000Z | 2019-06-17T06:56:28.000Z | """This module contains a function for setting the log level for paramiko."""
import logging
from idact.detail.log.get_logger import get_debug_logger
PARAMIKO_LOG_LEVEL = logging.WARNING
def set_paramiko_log_level():
"""Sets the log level for paramiko."""
transport = get_debug_logger('paramiko.transport')
... | 27.846154 | 77 | 0.779006 | import logging
from idact.detail.log.get_logger import get_debug_logger
PARAMIKO_LOG_LEVEL = logging.WARNING
def set_paramiko_log_level():
transport = get_debug_logger('paramiko.transport')
transport.setLevel(PARAMIKO_LOG_LEVEL)
| true | true |
1c2eb66c68f8848733b17a3cf4239ec78a433d0d | 7,298 | py | Python | configs/trainval/daotad_eccv2022/2.a.iii.1.py | klauscc/vedatad | c59f5ddc8fb227ef08baccbb513948bb1bb23857 | [
"Apache-2.0"
] | null | null | null | configs/trainval/daotad_eccv2022/2.a.iii.1.py | klauscc/vedatad | c59f5ddc8fb227ef08baccbb513948bb1bb23857 | [
"Apache-2.0"
] | null | null | null | configs/trainval/daotad_eccv2022/2.a.iii.1.py | klauscc/vedatad | c59f5ddc8fb227ef08baccbb513948bb1bb23857 | [
"Apache-2.0"
] | null | null | null | # 1. data
dataset_type = "Thumos14Dataset"
data_root = "data/thumos14/"
img_norm_cfg = dict(
mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True
)
num_frames = 480
img_shape = (224, 224)
overlap_ratio = 0.25
img_dir = "frames_15fps_256x256"
data = dict(
samples_per_gpu=4,
workers_per_g... | 28.960317 | 110 | 0.571252 |
dataset_type = "Thumos14Dataset"
data_root = "data/thumos14/"
img_norm_cfg = dict(
mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True
)
num_frames = 480
img_shape = (224, 224)
overlap_ratio = 0.25
img_dir = "frames_15fps_256x256"
data = dict(
samples_per_gpu=4,
workers_per_gpu=4,
... | true | true |
1c2eb69e1e3be5add0d649df44930718da7344ef | 797 | py | Python | miniurl_generic/url/migrations/0001_initial.py | yannisVentura/Django_MiniUrl_Bootstrap | 89a7cdb8c12ba75cf0cd2cb6206961506aad9287 | [
"BSD-3-Clause"
] | null | null | null | miniurl_generic/url/migrations/0001_initial.py | yannisVentura/Django_MiniUrl_Bootstrap | 89a7cdb8c12ba75cf0cd2cb6206961506aad9287 | [
"BSD-3-Clause"
] | 8 | 2017-04-05T13:15:39.000Z | 2017-10-17T09:39:04.000Z | miniurl_generic/url/migrations/0001_initial.py | yannisVentura/Django_MiniUrl_Bootstrap | 89a7cdb8c12ba75cf0cd2cb6206961506aad9287 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.10.1 on 2016-10-04 08:06
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='MiniUr... | 29.518519 | 114 | 0.603513 |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='MiniUrl',
fields=[
('id', models.AutoField(auto_c... | true | true |
1c2eb6b0bb8c9e52dc65101ee61fd393746c6d9b | 1,205 | py | Python | airflow/ti_deps/deps/dag_unpaused_dep.py | wileeam/airflow | f46be8152a4d89c57db4ca46f5b3339e4876b723 | [
"Apache-2.0"
] | 8 | 2017-04-20T16:15:44.000Z | 2020-10-11T13:44:10.000Z | airflow/ti_deps/deps/dag_unpaused_dep.py | devlocalca/airflow | 58c3542ed25061320ce61dbe0adf451a44c738dd | [
"Apache-2.0"
] | 219 | 2017-03-15T18:40:16.000Z | 2022-02-28T22:52:43.000Z | airflow/ti_deps/deps/dag_unpaused_dep.py | devlocalca/airflow | 58c3542ed25061320ce61dbe0adf451a44c738dd | [
"Apache-2.0"
] | 3 | 2016-07-14T21:51:10.000Z | 2020-10-12T13:26:36.000Z | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | 37.65625 | 71 | 0.744398 |
from airflow.ti_deps.deps.base_ti_dep import BaseTIDep
from airflow.utils.session import provide_session
class DagUnpausedDep(BaseTIDep):
NAME = "Dag Not Paused"
IGNOREABLE = True
@provide_session
def _get_dep_statuses(self, ti, session, dep_context):
if ti.task.dag.is_pause... | true | true |
1c2eb6fa73a233d255344a1bb49e88539d1b2bb5 | 616 | py | Python | leetcode/easy/intersection_of_two_arrays_ii/py/solution.py | lilsweetcaligula/Online-Judges | 48454a8e6b5b86f80e89eca1b396480df8960cfd | [
"MIT"
] | null | null | null | leetcode/easy/intersection_of_two_arrays_ii/py/solution.py | lilsweetcaligula/Online-Judges | 48454a8e6b5b86f80e89eca1b396480df8960cfd | [
"MIT"
] | null | null | null | leetcode/easy/intersection_of_two_arrays_ii/py/solution.py | lilsweetcaligula/Online-Judges | 48454a8e6b5b86f80e89eca1b396480df8960cfd | [
"MIT"
] | null | null | null | class Solution(object):
def intersect(self, nums1, nums2):
"""
:type nums1: List[int]
:type nums2: List[int]
:rtype: List[int]
"""
result = []
nums1 = sorted(nums1)
nums2 = sorted(nums2)
i = 0
j = 0
while i <... | 23.692308 | 48 | 0.371753 | class Solution(object):
def intersect(self, nums1, nums2):
result = []
nums1 = sorted(nums1)
nums2 = sorted(nums2)
i = 0
j = 0
while i < len(nums1) and j < len(nums2):
if nums1[i] == nums2[j]:
result.append(nums1[i])
... | true | true |
1c2eb71ead2363009a56bf89e169532913118a38 | 160 | py | Python | cards/apps.py | neosergio/WisdomBox | f41bd828f5e264c7ad05262b29c8f02cf904b54a | [
"MIT"
] | null | null | null | cards/apps.py | neosergio/WisdomBox | f41bd828f5e264c7ad05262b29c8f02cf904b54a | [
"MIT"
] | 2 | 2017-02-09T14:52:43.000Z | 2017-02-10T19:31:38.000Z | cards/apps.py | neosergio/WisdomBox | f41bd828f5e264c7ad05262b29c8f02cf904b54a | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
from django.apps import AppConfig
class CardsConfig(AppConfig):
name = 'cards'
verbose_name = 'Wisdom Cards'
| 17.777778 | 39 | 0.7625 | from __future__ import unicode_literals
from django.apps import AppConfig
class CardsConfig(AppConfig):
name = 'cards'
verbose_name = 'Wisdom Cards'
| true | true |
1c2eb726a627a42117538c0779f66d6db0987c03 | 218 | py | Python | stupidArtnet/__init__.py | verycollective/stupidArtnet | 80e7722598d06e1c533ffd28a92e26c784e23389 | [
"MIT"
] | 13 | 2018-11-07T20:19:57.000Z | 2020-07-31T23:15:00.000Z | stupidArtnet/__init__.py | digitalanimalscollective/stupidArtnet | 80e7722598d06e1c533ffd28a92e26c784e23389 | [
"MIT"
] | 2 | 2019-04-10T17:22:23.000Z | 2020-02-11T14:55:44.000Z | stupidArtnet/__init__.py | digitalanimalscollective/stupidArtnet | 80e7722598d06e1c533ffd28a92e26c784e23389 | [
"MIT"
] | 9 | 2019-03-01T12:00:27.000Z | 2020-07-30T19:34:15.000Z | """Facilitates library imports."""
from stupidArtnet.StupidArtnetServer import StupidArtnetServer
from stupidArtnet.ArtnetUtils import shift_this, put_in_range, make_address_mask
from .StupidArtnet import StupidArtnet
| 43.6 | 80 | 0.866972 | from stupidArtnet.StupidArtnetServer import StupidArtnetServer
from stupidArtnet.ArtnetUtils import shift_this, put_in_range, make_address_mask
from .StupidArtnet import StupidArtnet
| true | true |
1c2eb746dbf03c9401fcbe7364388d36d331e74a | 72 | py | Python | straph/paths/__init__.py | GiulioRossetti/Straph | edc021d25243bcca619c62dca1f28cf05b73a92c | [
"Apache-2.0"
] | 3 | 2021-05-24T16:23:51.000Z | 2021-08-07T20:14:53.000Z | straph/paths/__init__.py | GiulioRossetti/Straph | edc021d25243bcca619c62dca1f28cf05b73a92c | [
"Apache-2.0"
] | 1 | 2021-05-25T12:30:36.000Z | 2021-05-25T12:30:36.000Z | straph/paths/__init__.py | GiulioRossetti/Straph | edc021d25243bcca619c62dca1f28cf05b73a92c | [
"Apache-2.0"
] | 3 | 2021-05-25T09:04:43.000Z | 2021-11-02T16:27:23.000Z | from straph.paths.path_object import *
from straph.paths.paths import *
| 24 | 38 | 0.805556 | from straph.paths.path_object import *
from straph.paths.paths import *
| true | true |
1c2eb7cfed9158485e706c5f38abfc820fbb10d4 | 3,169 | py | Python | src/ef/field/__init__.py | fizmat/ef_python | 1fccdc90b1dd628c9adb5f8713bee4e4df633daf | [
"MIT"
] | 1 | 2018-12-13T08:32:46.000Z | 2018-12-13T08:32:46.000Z | src/ef/field/__init__.py | dumbman/ef_python | d26e48d3afd81c3b24a5ec207fce674cdc9609d3 | [
"MIT"
] | 3 | 2018-05-21T11:26:57.000Z | 2020-03-12T12:28:44.000Z | src/ef/field/__init__.py | dumbman/ef_python | d26e48d3afd81c3b24a5ec207fce674cdc9609d3 | [
"MIT"
] | null | null | null | import inject
import numpy as np
from ef.util.serializable_h5 import SerializableH5
class Field(SerializableH5):
def __init__(self, name, electric_or_magnetic):
self.name = name
self.electric_or_magnetic = electric_or_magnetic
def __add__(self, b):
return FieldSum.factory((self, b))
... | 38.180723 | 112 | 0.603976 | import inject
import numpy as np
from ef.util.serializable_h5 import SerializableH5
class Field(SerializableH5):
def __init__(self, name, electric_or_magnetic):
self.name = name
self.electric_or_magnetic = electric_or_magnetic
def __add__(self, b):
return FieldSum.factory((self, b))
... | true | true |
1c2eb7eb9834caf7eb2dfffa95fda486d9a9f4e3 | 35,676 | py | Python | pyrex/generation.py | abigailbishop/pyrex | 10ba2e9f4c8820f4fcf5f00bd866927dacb0b2b5 | [
"MIT"
] | 6 | 2018-06-19T16:01:35.000Z | 2020-05-21T20:02:53.000Z | pyrex/generation.py | bhokansonfasig/pyrex | 8b2abc954f2cf4945424042f33847b783c72dcfa | [
"MIT"
] | 4 | 2018-01-19T14:52:33.000Z | 2021-09-02T17:20:07.000Z | pyrex/generation.py | abigailbishop/pyrex | 10ba2e9f4c8820f4fcf5f00bd866927dacb0b2b5 | [
"MIT"
] | 5 | 2018-01-19T14:49:16.000Z | 2021-01-21T12:34:59.000Z | """
Module for particle (neutrino) generators.
Generators are responsible for the input of events into the simulation.
"""
from collections.abc import Iterable
from enum import Enum
import logging
import numpy as np
from pyrex.internal_functions import get_from_enum
from pyrex.earth_model import earth
from pyrex.par... | 35.927492 | 79 | 0.59746 |
from collections.abc import Iterable
from enum import Enum
import logging
import numpy as np
from pyrex.internal_functions import get_from_enum
from pyrex.earth_model import earth
from pyrex.particle import Event, Particle, NeutrinoInteraction
from pyrex.io import File
logger = logging.getLogger(__name__)
class Gen... | true | true |
1c2eb94162bd8c245bbcdc3f3cc42fa660d07460 | 6,069 | py | Python | routes.py | kuldeep24680/RESTAPI-for-analyzing-data-to-excel-uploaded-file-and-downloading-resultant-csv-files-on-flask | 5e3f35de2599f71078974c4e5a46bb94da426200 | [
"MIT"
] | null | null | null | routes.py | kuldeep24680/RESTAPI-for-analyzing-data-to-excel-uploaded-file-and-downloading-resultant-csv-files-on-flask | 5e3f35de2599f71078974c4e5a46bb94da426200 | [
"MIT"
] | null | null | null | routes.py | kuldeep24680/RESTAPI-for-analyzing-data-to-excel-uploaded-file-and-downloading-resultant-csv-files-on-flask | 5e3f35de2599f71078974c4e5a46bb94da426200 | [
"MIT"
] | null | null | null | from app import app
from flask import render_template, request,send_file
import pandas as pd
import csv
import xlrd
# to route the user the upload the .xlsx file
@app.route('/')
def upload_file():
return render_template('upload.html')
# function that converts the .xlsx file into .csv file and saves ... | 42.145833 | 215 | 0.672928 | from app import app
from flask import render_template, request,send_file
import pandas as pd
import csv
import xlrd
@app.route('/')
def upload_file():
return render_template('upload.html')
@app.route('/Fileupload', methods = ['POST'])
def upload():
if request.method == 'POST':
f = reque... | true | true |
1c2eb95134eb8fd3953659373a21b5dc998d5027 | 1,365 | py | Python | run_results.py | phylatechnologies/ibd_classification_benchmark | 667e0b42e70bd56c6675062b10dae38407e785b0 | [
"MIT"
] | null | null | null | run_results.py | phylatechnologies/ibd_classification_benchmark | 667e0b42e70bd56c6675062b10dae38407e785b0 | [
"MIT"
] | null | null | null | run_results.py | phylatechnologies/ibd_classification_benchmark | 667e0b42e70bd56c6675062b10dae38407e785b0 | [
"MIT"
] | null | null | null | import os
import pandas as pd
import numpy as np
from metadata.getters import get_pwd
from analysis.evaluation_methods import get_performance
import random
np.random.seed(26)
random.seed(26)
def get_sample_info(dataset):
'''
:param exp_name: experiment string
:return: unpickled data set
'''
data_fi... | 26.25 | 68 | 0.589744 | import os
import pandas as pd
import numpy as np
from metadata.getters import get_pwd
from analysis.evaluation_methods import get_performance
import random
np.random.seed(26)
random.seed(26)
def get_sample_info(dataset):
data_file = '{}.pkl'.format(dataset)
data_path = '{}/datasets/{}'.format(get_pwd(), data_f... | true | true |
1c2eb97d2acd29ed9d533618df715e94812ce8e5 | 27,136 | py | Python | macOS/Xcode/Maestral/Maestral/app_packages/survey/tools.py | productinfo/maestral-cocoa | d1626c68ace1939bd53cda53c53cbb43c9fb7a8e | [
"MIT"
] | 8 | 2020-11-13T08:48:01.000Z | 2021-12-16T06:30:27.000Z | macOS/Xcode/Maestral/Maestral/app_packages/survey/tools.py | productinfo/maestral-cocoa | d1626c68ace1939bd53cda53c53cbb43c9fb7a8e | [
"MIT"
] | 4 | 2022-01-05T09:16:30.000Z | 2022-03-29T09:32:44.000Z | macOS/Xcode/Maestral/Maestral/app_packages/survey/tools.py | productinfo/maestral-cocoa | d1626c68ace1939bd53cda53c53cbb43c9fb7a8e | [
"MIT"
] | 1 | 2022-01-05T08:56:59.000Z | 2022-01-05T08:56:59.000Z | import enum
import types
import wrapio
import os
import string
import itertools
from . import helpers
__all__ = ('Source', 'Translator', 'LineEditor', 'MultiLineEditor', 'Select',
'MultiSelect')
_blocks = string.whitespace + string.punctuation
class Source(helpers.Handle):
"""
Turns stdin rea... | 20.026568 | 79 | 0.532098 | import enum
import types
import wrapio
import os
import string
import itertools
from . import helpers
__all__ = ('Source', 'Translator', 'LineEditor', 'MultiLineEditor', 'Select',
'MultiSelect')
_blocks = string.whitespace + string.punctuation
class Source(helpers.Handle):
Event = enum.Enum(
... | true | true |
1c2eba00650c8b64ca478183c3d227a97692f36e | 1,439 | py | Python | nonebot/adapters/feishu/utils.py | nonebot/adapter-feishu | 392d734bbf09b88c2e7557102f2562111b84fce8 | [
"MIT"
] | 2 | 2021-11-29T16:05:17.000Z | 2022-03-21T07:45:50.000Z | nonebot/adapters/feishu/utils.py | nonebot/adapter-feishu | 392d734bbf09b88c2e7557102f2562111b84fce8 | [
"MIT"
] | 1 | 2022-03-16T07:26:10.000Z | 2022-03-16T07:26:10.000Z | nonebot/adapters/feishu/utils.py | nonebot/adapter-feishu | 392d734bbf09b88c2e7557102f2562111b84fce8 | [
"MIT"
] | null | null | null | import base64
import hashlib
from typing import Any, Dict, Optional
from cashews import cache
from Crypto.Cipher import AES
from nonebot.utils import logger_wrapper
from .exception import ActionFailed
log = logger_wrapper("FEISHU")
cache.setup("mem://")
def _handle_api_result(result: Optional[Dict[str, Any]]) -> ... | 21.80303 | 71 | 0.607366 | import base64
import hashlib
from typing import Any, Dict, Optional
from cashews import cache
from Crypto.Cipher import AES
from nonebot.utils import logger_wrapper
from .exception import ActionFailed
log = logger_wrapper("FEISHU")
cache.setup("mem://")
def _handle_api_result(result: Optional[Dict[str, Any]]) -> ... | true | true |
1c2ebb4b49d5630a42fbb2d8a231e20140c8bd57 | 13,933 | py | Python | src/tashi/clustermanager/data/sql.py | apache/tashi | 87f55e4d30800c085ea786bf40c9412b816969e6 | [
"Apache-2.0"
] | 6 | 2015-02-26T22:52:15.000Z | 2021-11-10T16:04:40.000Z | src/tashi/clustermanager/data/sql.py | stroucki/tashi | 6888a865c184ea80f10e70981addc73a262a81b7 | [
"Apache-2.0"
] | null | null | null | src/tashi/clustermanager/data/sql.py | stroucki/tashi | 6888a865c184ea80f10e70981addc73a262a81b7 | [
"Apache-2.0"
] | 6 | 2015-06-29T19:03:20.000Z | 2021-11-10T16:04:30.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 34.402469 | 365 | 0.676523 |
import logging
import threading
import os
from tashi.rpycservices.rpyctypes import Errors, Network, Host, User, Instance, TashiException, LocalImages, DiskConfiguration, NetworkConfiguration
from tashi.clustermanager.data.datainterface import DataInterface
from tashi.util import stringPartition, boole... | false | true |
1c2ebcb9f1c7e30c527922e1b531e8cc615065de | 1,998 | py | Python | src/oidcop/session/info.py | MdreW/oidc-op | 684355981ea12516e1b5ef3ed72a4ecf572109bf | [
"Apache-2.0"
] | null | null | null | src/oidcop/session/info.py | MdreW/oidc-op | 684355981ea12516e1b5ef3ed72a4ecf572109bf | [
"Apache-2.0"
] | null | null | null | src/oidcop/session/info.py | MdreW/oidc-op | 684355981ea12516e1b5ef3ed72a4ecf572109bf | [
"Apache-2.0"
] | null | null | null | from typing import List
from typing import Optional
from oidcmsg.impexp import ImpExp
class SessionInfo(ImpExp):
parameter = {"subordinate": [], "revoked": bool, "type": "", "extra_args": {}}
def __init__(
self,
subordinate: Optional[List[str]] = None,
revoked: Optional[bool] = False... | 28.140845 | 86 | 0.610611 | from typing import List
from typing import Optional
from oidcmsg.impexp import ImpExp
class SessionInfo(ImpExp):
parameter = {"subordinate": [], "revoked": bool, "type": "", "extra_args": {}}
def __init__(
self,
subordinate: Optional[List[str]] = None,
revoked: Optional[bool] = False... | true | true |
1c2ebce233d748bc3dbd55e3e7f871b51601686e | 21,795 | py | Python | ModernWarfare/modernwarfare.py | EthanC/Hyde | 0325eb12c5849dbe4e4b317bd8d3f026c989e7f9 | [
"MIT"
] | 14 | 2020-05-01T13:54:48.000Z | 2022-02-14T21:58:35.000Z | ModernWarfare/modernwarfare.py | EthanC/Hyde | 0325eb12c5849dbe4e4b317bd8d3f026c989e7f9 | [
"MIT"
] | 3 | 2020-06-09T19:24:48.000Z | 2021-03-06T11:34:04.000Z | ModernWarfare/modernwarfare.py | EthanC/Hyde | 0325eb12c5849dbe4e4b317bd8d3f026c989e7f9 | [
"MIT"
] | 4 | 2020-05-24T19:15:08.000Z | 2022-02-04T21:20:29.000Z | import logging
from typing import Any, Dict, List, Optional, TypedDict
from utility import Utility
from .database import Database
from .XAssets import (
Accessories,
BattlePasses,
BattlePassItems,
Bundles,
CallingCards,
Camos,
Charms,
Consumables,
Emblems,
Equipment,
Execut... | 36.446488 | 86 | 0.590411 | import logging
from typing import Any, Dict, List, Optional, TypedDict
from utility import Utility
from .database import Database
from .XAssets import (
Accessories,
BattlePasses,
BattlePassItems,
Bundles,
CallingCards,
Camos,
Charms,
Consumables,
Emblems,
Equipment,
Execut... | true | true |
1c2ebde3b00cdb9bb24577d73bec47be925bfeac | 3,686 | py | Python | _static/cookbook/gravmag_harvester_tensor.py | fatiando/v0.1 | 1ab9876b247c67834b8e1c874d5b1d86f82802e2 | [
"BSD-3-Clause"
] | null | null | null | _static/cookbook/gravmag_harvester_tensor.py | fatiando/v0.1 | 1ab9876b247c67834b8e1c874d5b1d86f82802e2 | [
"BSD-3-Clause"
] | null | null | null | _static/cookbook/gravmag_harvester_tensor.py | fatiando/v0.1 | 1ab9876b247c67834b8e1c874d5b1d86f82802e2 | [
"BSD-3-Clause"
] | null | null | null | """
GravMag: 3D gravity gradient inversion by planting anomalous densities using
``harvester`` (with non-targeted sources)
"""
from fatiando import logger, gridder, utils
from fatiando import gravmag as gm
from fatiando.mesher import Prism, PrismMesh, vremove
from fatiando.vis import mpl, myv
log = logger.get()
log.in... | 36.86 | 76 | 0.641346 | """
GravMag: 3D gravity gradient inversion by planting anomalous densities using
``harvester`` (with non-targeted sources)
"""
from fatiando import logger, gridder, utils
from fatiando import gravmag as gm
from fatiando.mesher import Prism, PrismMesh, vremove
from fatiando.vis import mpl, myv
log = logger.get()
log.in... | false | true |
1c2ebfbba2889019f3daeaf8c2c41e1faae71ede | 896 | py | Python | examples/core/produce_c_file.py | fengjixuchui/src | 0c5a6cd8057717f73b1373f8d85eb9b19e1934e1 | [
"BSD-3-Clause"
] | 1,160 | 2015-05-02T15:13:20.000Z | 2022-03-31T20:04:28.000Z | examples/core/produce_c_file.py | fengjixuchui/src | 0c5a6cd8057717f73b1373f8d85eb9b19e1934e1 | [
"BSD-3-Clause"
] | 19 | 2015-04-20T13:47:00.000Z | 2021-07-07T13:00:42.000Z | examples/core/produce_c_file.py | fengjixuchui/src | 0c5a6cd8057717f73b1373f8d85eb9b19e1934e1 | [
"BSD-3-Clause"
] | 257 | 2015-04-01T21:42:33.000Z | 2022-03-10T11:57:51.000Z | """
summary: decompile entire file
description:
automate IDA to perform auto-analysis on a file and,
once that is done, produce a .c file containing the
decompilation of all the functions in that file.
Run like so:
ida -A "-S...path/to/produce_c_file.py" <binary-file>
where:
* -A instructs ID... | 23.578947 | 72 | 0.722098 |
import ida_pro
import ida_auto
import ida_loader
import ida_hexrays
idb_path = ida_loader.get_path(ida_loader.PATH_TYPE_IDB)
c_path = "%s.c" % idb_path
ida_auto.auto_wait()
ida_hexrays.decompile_many(
c_path,
None,
ida_hexrays.VDRUN_NEWFILE
|ida_hexrays.VDRUN_SILENT
|ida_hexrays.VDRUN_MAYSTOP)
... | true | true |
1c2ebfd75fe3944d8065afbbfce8e4cb94d66e50 | 13,075 | py | Python | src/saml2/httpbase.py | skanct/pysaml2 | 0c1e26a6dd8759962857a30ebd67f63fe9e881ee | [
"Apache-2.0"
] | 5,079 | 2015-01-01T03:39:46.000Z | 2022-03-31T07:38:22.000Z | desktop/core/ext-py/pysaml2-4.4.0/src/saml2/httpbase.py | zks888/hue | 93a8c370713e70b216c428caa2f75185ef809deb | [
"Apache-2.0"
] | 1,623 | 2015-01-01T08:06:24.000Z | 2022-03-30T19:48:52.000Z | desktop/core/ext-py/pysaml2-4.4.0/src/saml2/httpbase.py | zks888/hue | 93a8c370713e70b216c428caa2f75185ef809deb | [
"Apache-2.0"
] | 2,033 | 2015-01-04T07:18:02.000Z | 2022-03-28T19:55:47.000Z | import calendar
import six
from six.moves import http_cookiejar
import copy
import re
from six.moves.urllib.parse import urlparse
from six.moves.urllib.parse import urlencode
import requests
import time
from six.moves.http_cookies import SimpleCookie
from saml2.time_util import utc_now
from saml2 import class_name, SAM... | 31.735437 | 95 | 0.524512 | import calendar
import six
from six.moves import http_cookiejar
import copy
import re
from six.moves.urllib.parse import urlparse
from six.moves.urllib.parse import urlencode
import requests
import time
from six.moves.http_cookies import SimpleCookie
from saml2.time_util import utc_now
from saml2 import class_name, SAM... | true | true |
1c2ec000659f19143f2f3a883502db0eb1d71d33 | 6,398 | py | Python | Chapter_Clustering_GMM/ProcessMonitoring_GMM.py | ML-PSE/Machine_Learning_for_PSE | b53578d7cc0e0eca4907527b188a60de06d6710e | [
"Apache-2.0"
] | 2 | 2022-02-20T18:57:46.000Z | 2022-03-03T07:07:12.000Z | Chapter_Clustering_GMM/ProcessMonitoring_GMM.py | ML-PSE/Machine_Learning_for_PSE | b53578d7cc0e0eca4907527b188a60de06d6710e | [
"Apache-2.0"
] | null | null | null | Chapter_Clustering_GMM/ProcessMonitoring_GMM.py | ML-PSE/Machine_Learning_for_PSE | b53578d7cc0e0eca4907527b188a60de06d6710e | [
"Apache-2.0"
] | null | null | null | ##%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
## Process Monitoring of Etch data
## %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#%% import required packages
import numpy as np
import matplotlib.pyplot as plt
from sklearn... | 36.770115 | 165 | 0.595186 | atlab_data['LAMDATA']
calibration_dataAll = Etch_data[0,0].calibration
variable_names = Etch_data[0,0].variables
0][5:90,2:]
if calibration_expt.shape[0] < 85:
continue
unfolded_row = np.ravel(calibration_expt, order='F')[np.newaxis,:]
unfolded_dataMatrix = np.vstack((unfolded... | true | true |
1c2ec0204f13deadf34e31a40a561e0198ba50a8 | 665 | py | Python | src/genie/libs/parser/bigip/get_net_sfcchain.py | nujo/genieparser | 083b01efc46afc32abe1a1858729578beab50cd3 | [
"Apache-2.0"
] | 204 | 2018-06-27T00:55:27.000Z | 2022-03-06T21:12:18.000Z | src/genie/libs/parser/bigip/get_net_sfcchain.py | nujo/genieparser | 083b01efc46afc32abe1a1858729578beab50cd3 | [
"Apache-2.0"
] | 468 | 2018-06-19T00:33:18.000Z | 2022-03-31T23:23:35.000Z | src/genie/libs/parser/bigip/get_net_sfcchain.py | nujo/genieparser | 083b01efc46afc32abe1a1858729578beab50cd3 | [
"Apache-2.0"
] | 309 | 2019-01-16T20:21:07.000Z | 2022-03-30T12:56:41.000Z | # Global Imports
import json
from collections import defaultdict
# Metaparser
from genie.metaparser import MetaParser
# =============================================
# Collection for '/mgmt/tm/net/sfc/chain' resources
# =============================================
class NetSfcChainSchema(MetaParser):
schema =... | 19.558824 | 52 | 0.578947 |
import json
from collections import defaultdict
from genie.metaparser import MetaParser
class NetSfcChainSchema(MetaParser):
schema = {}
class NetSfcChain(NetSfcChainSchema):
cli_command = "/mgmt/tm/net/sfc/chain"
def rest(self):
response = self.device.get(self.cli_command)
r... | true | true |
1c2ec05a5b77d971e797ce93d09ecd74e83f2274 | 585 | py | Python | tests/common/server_sent_events/sse4python/test_web_request_factory.py | yellowdog/yellowdog-sdk-python-public | da69a7d6e45c92933e34fefcaef8b5d98dcd6036 | [
"Apache-2.0"
] | null | null | null | tests/common/server_sent_events/sse4python/test_web_request_factory.py | yellowdog/yellowdog-sdk-python-public | da69a7d6e45c92933e34fefcaef8b5d98dcd6036 | [
"Apache-2.0"
] | null | null | null | tests/common/server_sent_events/sse4python/test_web_request_factory.py | yellowdog/yellowdog-sdk-python-public | da69a7d6e45c92933e34fefcaef8b5d98dcd6036 | [
"Apache-2.0"
] | null | null | null | from yellowdog_client.common.server_sent_events.sse4python import WebRequestFactory
class TestCreate(object):
def test__expect_requester_returned_with_headers_passed(self, mocker):
mock_requester = mocker.patch(
"yellowdog_client.common.server_sent_events.sse4python.web_request_factory.WebRequ... | 34.411765 | 100 | 0.752137 | from yellowdog_client.common.server_sent_events.sse4python import WebRequestFactory
class TestCreate(object):
def test__expect_requester_returned_with_headers_passed(self, mocker):
mock_requester = mocker.patch(
"yellowdog_client.common.server_sent_events.sse4python.web_request_factory.WebRequ... | true | true |
1c2ec0f20aafdc10453e7ffdfe838dced43ab3ef | 50,440 | py | Python | wagtail/admin/views/pages.py | kjartansverrisson/wagtail | d202195333e11faf5e1c42fc9a154cbe88d5e689 | [
"BSD-3-Clause"
] | null | null | null | wagtail/admin/views/pages.py | kjartansverrisson/wagtail | d202195333e11faf5e1c42fc9a154cbe88d5e689 | [
"BSD-3-Clause"
] | 2 | 2020-05-01T06:02:28.000Z | 2020-09-24T09:27:08.000Z | wagtail/admin/views/pages.py | kjartansverrisson/wagtail | d202195333e11faf5e1c42fc9a154cbe88d5e689 | [
"BSD-3-Clause"
] | 1 | 2020-03-09T08:05:56.000Z | 2020-03-09T08:05:56.000Z | from time import time
from django.contrib.contenttypes.models import ContentType
from django.core.exceptions import PermissionDenied
from django.core.paginator import Paginator
from django.db import transaction
from django.db.models import Count
from django.http import Http404, HttpResponse, JsonResponse
from django.h... | 38.979907 | 195 | 0.628886 | from time import time
from django.contrib.contenttypes.models import ContentType
from django.core.exceptions import PermissionDenied
from django.core.paginator import Paginator
from django.db import transaction
from django.db.models import Count
from django.http import Http404, HttpResponse, JsonResponse
from django.h... | true | true |
1c2ec2a5a869df996ee9bf32ef07179dc62555f2 | 2,633 | py | Python | src/test/parser/template/node_tests/test_base.py | narnikgamarnikus/program-y | 777b9a8a75ec787c037de9f11a8527875ff450b1 | [
"MIT"
] | null | null | null | src/test/parser/template/node_tests/test_base.py | narnikgamarnikus/program-y | 777b9a8a75ec787c037de9f11a8527875ff450b1 | [
"MIT"
] | null | null | null | src/test/parser/template/node_tests/test_base.py | narnikgamarnikus/program-y | 777b9a8a75ec787c037de9f11a8527875ff450b1 | [
"MIT"
] | null | null | null | import xml.etree.ElementTree as ET
from programy.parser.template.nodes.base import TemplateNode
from programy.parser.template.nodes.word import TemplateWordNode
from programy.parser.template.nodes.id import TemplateIdNode
from programy.parser.template.nodes.srai import TemplateSRAINode
from test.parser.template.base ... | 40.507692 | 118 | 0.64793 | import xml.etree.ElementTree as ET
from programy.parser.template.nodes.base import TemplateNode
from programy.parser.template.nodes.word import TemplateWordNode
from programy.parser.template.nodes.id import TemplateIdNode
from programy.parser.template.nodes.srai import TemplateSRAINode
from test.parser.template.base ... | true | true |
1c2ec2a610c90310555eabd176019815f61ca306 | 422 | py | Python | pollster/urls.py | Timoh97/eVote-Intell | 20044a41b41a5437eebc6c704592c0b0bf85d92a | [
"MIT"
] | null | null | null | pollster/urls.py | Timoh97/eVote-Intell | 20044a41b41a5437eebc6c704592c0b0bf85d92a | [
"MIT"
] | null | null | null | pollster/urls.py | Timoh97/eVote-Intell | 20044a41b41a5437eebc6c704592c0b0bf85d92a | [
"MIT"
] | null | null | null |
from django.contrib import admin
from django.urls import include, path
from django.conf import settings
from django.conf.urls.static import static
urlpatterns = [
path('', include('pages.urls')),
path('polls/', include('polls.urls')),
path('admin/', admin.site.urls),
path('', include('users.urls')),
]... | 26.375 | 80 | 0.71327 |
from django.contrib import admin
from django.urls import include, path
from django.conf import settings
from django.conf.urls.static import static
urlpatterns = [
path('', include('pages.urls')),
path('polls/', include('polls.urls')),
path('admin/', admin.site.urls),
path('', include('users.urls')),
]... | true | true |
1c2ec34f43ca0917576c97710652026196d402a3 | 445 | py | Python | helpers.py | pawangeek/Innovacer-Intern | 1b3e239a63244670b72a2c0c0513d75c0d95cd86 | [
"MIT"
] | null | null | null | helpers.py | pawangeek/Innovacer-Intern | 1b3e239a63244670b72a2c0c0513d75c0d95cd86 | [
"MIT"
] | 1 | 2021-06-02T00:45:03.000Z | 2021-06-02T00:45:03.000Z | helpers.py | pawangeek/Innovacer-Intern | 1b3e239a63244670b72a2c0c0513d75c0d95cd86 | [
"MIT"
] | null | null | null | from twilio.rest import Client
import smtplib
def sendmail(message,sender,receiver,password):
s = smtplib.SMTP('smtp.gmail.com', 587)
s.starttls()
s.login(sender, password)
s.sendmail(sender, receiver, message)
s.quit()
def sendmsg(message,receiver):
account_sid = ''
auth_token = ''
c... | 26.176471 | 84 | 0.703371 | from twilio.rest import Client
import smtplib
def sendmail(message,sender,receiver,password):
s = smtplib.SMTP('smtp.gmail.com', 587)
s.starttls()
s.login(sender, password)
s.sendmail(sender, receiver, message)
s.quit()
def sendmsg(message,receiver):
account_sid = ''
auth_token = ''
c... | true | true |
1c2ec438c82f5d97cc085888116ae9b52dc90aef | 3,927 | py | Python | videos-master/_2018/eop/chapter1/million_flips.py | samsmusa/My-manim-master | a79266ea21fbb7e84d0133030146549f381c31cb | [
"MIT"
] | 5 | 2021-03-18T02:28:07.000Z | 2021-04-10T03:40:24.000Z | videos-master/_2018/eop/chapter1/million_flips.py | samsmusa/My-manim-master | a79266ea21fbb7e84d0133030146549f381c31cb | [
"MIT"
] | null | null | null | videos-master/_2018/eop/chapter1/million_flips.py | samsmusa/My-manim-master | a79266ea21fbb7e84d0133030146549f381c31cb | [
"MIT"
] | 1 | 2022-02-16T03:22:47.000Z | 2022-02-16T03:22:47.000Z | from manim_imports_ext import *
from _2018.eop.reusable_imports import *
class MillionFlips(Scene):
def construct(self):
title = TexText("1{,}000{,}000 flips")
title.to_edge(UP)
self.add(title)
small_wait_time = 1.0 / 15 # Um...
n_flips_label = TexText("\\# Flips: ")
... | 33 | 76 | 0.569646 | from manim_imports_ext import *
from _2018.eop.reusable_imports import *
class MillionFlips(Scene):
def construct(self):
title = TexText("1{,}000{,}000 flips")
title.to_edge(UP)
self.add(title)
small_wait_time = 1.0 / 15
n_flips_label = TexText("\\# Flips: ")
n_... | true | true |
1c2ec67d2fe3ccd4f635ade02be7acc0755fd5d1 | 1,381 | py | Python | node-client/CasperLabs.py | wimel/CasperLabs | 40be04ada8c718eebf765519f25b86d381276bd4 | [
"Apache-2.0"
] | null | null | null | node-client/CasperLabs.py | wimel/CasperLabs | 40be04ada8c718eebf765519f25b86d381276bd4 | [
"Apache-2.0"
] | null | null | null | node-client/CasperLabs.py | wimel/CasperLabs | 40be04ada8c718eebf765519f25b86d381276bd4 | [
"Apache-2.0"
] | null | null | null | '''CasperLabs node client
Usage:
python CasperLabs.py contract1.rho
python CasperLabs.py -c 'new x in { x!(1 + 1) }'
We assume the CasperLabs node is running and that it is listening on port
5000. Double-check that you see this message in the logs:
Server started, listening on 50000
The output should be somet... | 25.574074 | 73 | 0.642288 |
from __future__ import print_function
import repl_pb2
import repl_pb2_grpc
def main(argv, stdout, insecure_channel,
host='127.0.0.1',
port=50000):
channel = insecure_channel('%s:%s' % (host, port))
replCh = repl_pb2_grpc.ReplStub(channel)
if '-c' in argv:
line = argv[-1]
... | true | true |
1c2ec69d36b4278d011acfe99a84032bb18b7934 | 5,259 | py | Python | maskrcnn_benchmark/data/datasets/coco.py | Iamal1/maskrcnn-benchmark | d53c1986e72c6a647179f5bf0e060db1160a1a42 | [
"MIT"
] | null | null | null | maskrcnn_benchmark/data/datasets/coco.py | Iamal1/maskrcnn-benchmark | d53c1986e72c6a647179f5bf0e060db1160a1a42 | [
"MIT"
] | null | null | null | maskrcnn_benchmark/data/datasets/coco.py | Iamal1/maskrcnn-benchmark | d53c1986e72c6a647179f5bf0e060db1160a1a42 | [
"MIT"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
import torch
import torchvision
from maskrcnn_benchmark.structures.bounding_box import BoxList
from maskrcnn_benchmark.structures.segmentation_mask import SegmentationMask
from maskrcnn_benchmark.structures.keypoint import PersonKeypoints
from to... | 36.520833 | 113 | 0.630728 |
import torch
import torchvision
from maskrcnn_benchmark.structures.bounding_box import BoxList
from maskrcnn_benchmark.structures.segmentation_mask import SegmentationMask
from maskrcnn_benchmark.structures.keypoint import PersonKeypoints
from torch.distributions.beta import Beta
from PIL import Image
import logging... | true | true |
1c2ec6bfe2a778c2f3ba4dae7483d3570eecd2f4 | 5,425 | py | Python | volatility/volatility/plugins/moddump.py | williamclot/MemoryVisualizer | 2ff9f30f07519d6578bc36c12f8d08acc9cb4383 | [
"MIT"
] | 2 | 2018-07-16T13:30:40.000Z | 2018-07-17T12:02:05.000Z | volatility/volatility/plugins/moddump.py | williamclot/MemoryVisualizer | 2ff9f30f07519d6578bc36c12f8d08acc9cb4383 | [
"MIT"
] | null | null | null | volatility/volatility/plugins/moddump.py | williamclot/MemoryVisualizer | 2ff9f30f07519d6578bc36c12f8d08acc9cb4383 | [
"MIT"
] | null | null | null | # Volatility
# Copyright (C) 2007-2013 Volatility Foundation
# Copyright (c) 2008 Brendan Dolan-Gavitt <bdolangavitt@wesleyan.edu>
#
# Additional Authors:
# Mike Auty <mike.auty@gmail.com>
#
# This file is part of Volatility.
#
# Volatility is free software; you can redistribute it and/or modify
# it under the terms of... | 43.055556 | 162 | 0.602212 |
import os
import re
from volatility import renderers
import volatility.plugins.procdump as procdump
import volatility.cache as cache
from volatility.renderers.basic import Address
import volatility.win32.modules as modules
import volatility.win32.tasks as tasks
import volatility.utils as utils
im... | false | true |
1c2ec7b68935225eff86132b336f0e0e3d582fbb | 518 | py | Python | tests/extension/thread_/stream_ringbuffer_stall/test_thread_stream_ringbuffer_stall.py | jesseclin/veriloggen | a645f2c53f04e5b88213eef17779d212192ea2b5 | [
"Apache-2.0"
] | 232 | 2015-09-01T16:07:48.000Z | 2022-03-28T14:53:28.000Z | tests/extension/thread_/stream_ringbuffer_stall/test_thread_stream_ringbuffer_stall.py | jesseclin/veriloggen | a645f2c53f04e5b88213eef17779d212192ea2b5 | [
"Apache-2.0"
] | 34 | 2015-08-21T09:13:03.000Z | 2022-03-21T23:52:44.000Z | tests/extension/thread_/stream_ringbuffer_stall/test_thread_stream_ringbuffer_stall.py | jesseclin/veriloggen | a645f2c53f04e5b88213eef17779d212192ea2b5 | [
"Apache-2.0"
] | 46 | 2015-09-24T14:39:57.000Z | 2022-02-23T21:59:56.000Z | from __future__ import absolute_import
from __future__ import print_function
import os
import veriloggen
import thread_stream_ringbuffer_stall
def test(request):
veriloggen.reset()
simtype = request.config.getoption('--sim')
rslt = thread_stream_ringbuffer_stall.run(filename=None, simtype=simtype,
... | 27.263158 | 114 | 0.69112 | from __future__ import absolute_import
from __future__ import print_function
import os
import veriloggen
import thread_stream_ringbuffer_stall
def test(request):
veriloggen.reset()
simtype = request.config.getoption('--sim')
rslt = thread_stream_ringbuffer_stall.run(filename=None, simtype=simtype,
... | true | true |
1c2eca595410e26023ed5a93ba28e9991119cccd | 12,483 | py | Python | 2021/Problem 24.py | christopherliu/advent-of-code | d18b54c538e7af608ba2efd92bf469b28ad5fe98 | [
"MIT"
] | null | null | null | 2021/Problem 24.py | christopherliu/advent-of-code | d18b54c538e7af608ba2efd92bf469b28ad5fe98 | [
"MIT"
] | null | null | null | 2021/Problem 24.py | christopherliu/advent-of-code | d18b54c538e7af608ba2efd92bf469b28ad5fe98 | [
"MIT"
] | null | null | null | import itertools
from dataclasses import dataclass
@dataclass
class Instruction:
name: "str" = None
argA: "str" = None
argB: "str" = None
class MONAD():
def __init__(self, instructions):
self.instructions = instructions
def reset(self):
self.variables = {
"w": 0,
... | 54.991189 | 250 | 0.621325 | import itertools
from dataclasses import dataclass
@dataclass
class Instruction:
name: "str" = None
argA: "str" = None
argB: "str" = None
class MONAD():
def __init__(self, instructions):
self.instructions = instructions
def reset(self):
self.variables = {
"w": 0,
... | true | true |
1c2eca9be52290e0ec2122ab12558d3900b0af13 | 145 | py | Python | functions/cmd_print.py | morozoffnor/govnoed_grisha_rewritten | 6a34336cede03a081954479f998d5a8162e1a31d | [
"Apache-2.0"
] | null | null | null | functions/cmd_print.py | morozoffnor/govnoed_grisha_rewritten | 6a34336cede03a081954479f998d5a8162e1a31d | [
"Apache-2.0"
] | null | null | null | functions/cmd_print.py | morozoffnor/govnoed_grisha_rewritten | 6a34336cede03a081954479f998d5a8162e1a31d | [
"Apache-2.0"
] | null | null | null | async def cmd_print(type, msg):
if type == 'debug':
print('[DEBUG] ' + msg)
elif type == 'error':
print('[ERROR] ' + msg) | 29 | 31 | 0.510345 | async def cmd_print(type, msg):
if type == 'debug':
print('[DEBUG] ' + msg)
elif type == 'error':
print('[ERROR] ' + msg) | true | true |
1c2ecbe1f6b05a7858b30f9647bf59ee17958586 | 6,952 | py | Python | robonomics_liability/src/robonomics_liability/LiabilityExecutionsPersistence.py | Vourhey/robonomics_comm | 1b7c6dc85985909cb925d82b1081ec556423029e | [
"BSD-3-Clause"
] | 16 | 2017-11-15T15:20:34.000Z | 2021-08-05T03:08:13.000Z | robonomics_liability/src/robonomics_liability/LiabilityExecutionsPersistence.py | aang1985/robonomics_comm | 4f7a339e01cbd00fc0f51405c77d89d6ae5e0d7d | [
"BSD-3-Clause"
] | 80 | 2018-02-08T22:44:41.000Z | 2021-07-15T10:12:09.000Z | robonomics_liability/src/robonomics_liability/LiabilityExecutionsPersistence.py | aang1985/robonomics_comm | 4f7a339e01cbd00fc0f51405c77d89d6ae5e0d7d | [
"BSD-3-Clause"
] | 13 | 2018-02-08T14:22:26.000Z | 2021-11-20T00:29:14.000Z | import rospy
import shelve
import time
from threading import Lock, Timer
from robonomics_liability.msg import Liability, LiabilityExecutionTimestamp
from robonomics_liability.srv import PersistenceContainsLiability, PersistenceContainsLiabilityResponse, PersistenceLiabilityTimestamp, PersistenceLiabilityTimestampRespon... | 49.657143 | 173 | 0.710875 | import rospy
import shelve
import time
from threading import Lock, Timer
from robonomics_liability.msg import Liability, LiabilityExecutionTimestamp
from robonomics_liability.srv import PersistenceContainsLiability, PersistenceContainsLiabilityResponse, PersistenceLiabilityTimestamp, PersistenceLiabilityTimestampRespon... | true | true |
1c2ecc0bdc1577aaf9719ce2cb15ff731c7a3042 | 9,728 | py | Python | old_stuff/main_q.py | weightan/quaternion_polynomials | 50d00bb883c4a4249f13154cffcb459a1319ecb9 | [
"MIT"
] | null | null | null | old_stuff/main_q.py | weightan/quaternion_polynomials | 50d00bb883c4a4249f13154cffcb459a1319ecb9 | [
"MIT"
] | null | null | null | old_stuff/main_q.py | weightan/quaternion_polynomials | 50d00bb883c4a4249f13154cffcb459a1319ecb9 | [
"MIT"
] | null | null | null | import quaternion
import numpy as np
import math
import time
import random
from pol_div import *
import cmath
from tqdm import tqdm
import matplotlib.pyplot as plt
from numpy import linalg as LA
iterations = 1_0_000
maxV = 280
N = 2000
cmap = 'hot'
scal = 6
dt = 0.02
size = 10
rootsPr = []
def log_dansity_map(v... | 24.879795 | 120 | 0.458059 | import quaternion
import numpy as np
import math
import time
import random
from pol_div import *
import cmath
from tqdm import tqdm
import matplotlib.pyplot as plt
from numpy import linalg as LA
iterations = 1_0_000
maxV = 280
N = 2000
cmap = 'hot'
scal = 6
dt = 0.02
size = 10
rootsPr = []
def log_dansity_map(v... | false | true |
1c2ecd001c90904790561e0bd820cdd3c213c213 | 3,282 | py | Python | frameworks/Python/fastapi/app.py | tommilligan/FrameworkBenchmarks | a5bad622429f14f13d872589d7054aefaa75002d | [
"BSD-3-Clause"
] | 5,300 | 2015-01-02T08:04:20.000Z | 2022-03-31T10:08:33.000Z | frameworks/Python/fastapi/app.py | tommilligan/FrameworkBenchmarks | a5bad622429f14f13d872589d7054aefaa75002d | [
"BSD-3-Clause"
] | 3,075 | 2015-01-01T05:11:45.000Z | 2022-03-31T23:56:33.000Z | frameworks/Python/fastapi/app.py | tommilligan/FrameworkBenchmarks | a5bad622429f14f13d872589d7054aefaa75002d | [
"BSD-3-Clause"
] | 2,151 | 2015-01-02T14:16:09.000Z | 2022-03-30T00:15:26.000Z | import asyncio
import asyncpg
import os
import jinja2
from fastapi import FastAPI
from starlette.responses import HTMLResponse, UJSONResponse, PlainTextResponse
from random import randint
from operator import itemgetter
from urllib.parse import parse_qs
READ_ROW_SQL = 'SELECT "randomnumber", "id" FROM "world" WHERE i... | 27.579832 | 83 | 0.704144 | import asyncio
import asyncpg
import os
import jinja2
from fastapi import FastAPI
from starlette.responses import HTMLResponse, UJSONResponse, PlainTextResponse
from random import randint
from operator import itemgetter
from urllib.parse import parse_qs
READ_ROW_SQL = 'SELECT "randomnumber", "id" FROM "world" WHERE i... | true | true |
1c2ecd7374ac4b43cc0c12a94a556e95164106a8 | 190 | py | Python | tests/test_train.py | hugobb/sgda | 69dcda47bb2c5b76d46ead32eb46ab5fb5e5e6d3 | [
"MIT"
] | 1 | 2022-02-16T04:20:02.000Z | 2022-02-16T04:20:02.000Z | tests/test_train.py | hugobb/sgda | 69dcda47bb2c5b76d46ead32eb46ab5fb5e5e6d3 | [
"MIT"
] | null | null | null | tests/test_train.py | hugobb/sgda | 69dcda47bb2c5b76d46ead32eb46ab5fb5e5e6d3 | [
"MIT"
] | null | null | null | import unittest
from gamesopt.train import train, TrainConfig
class TestOptimizer(unittest.TestCase):
def test_sgda(self):
config = TrainConfig(num_iter=2)
train(config) | 27.142857 | 45 | 0.736842 | import unittest
from gamesopt.train import train, TrainConfig
class TestOptimizer(unittest.TestCase):
def test_sgda(self):
config = TrainConfig(num_iter=2)
train(config) | true | true |
1c2ecdc1af37318f9cd7610ded59ac8671542db2 | 1,589 | py | Python | cinema/mainapp/models.py | Floou/cinema | 83a921ff802abaa632c336db4f9e5f4ca2907199 | [
"Apache-2.0"
] | null | null | null | cinema/mainapp/models.py | Floou/cinema | 83a921ff802abaa632c336db4f9e5f4ca2907199 | [
"Apache-2.0"
] | null | null | null | cinema/mainapp/models.py | Floou/cinema | 83a921ff802abaa632c336db4f9e5f4ca2907199 | [
"Apache-2.0"
] | null | null | null | from django.db import models, transaction, DatabaseError
from authapp.models import UserProfile
class Film(models.Model):
title = models.CharField(max_length=128, unique=True)
description = models.TextField()
# image = models.ImageField(upload_to='')
audience = models.ManyToManyField('authapp.UserProf... | 30.557692 | 85 | 0.670233 | from django.db import models, transaction, DatabaseError
from authapp.models import UserProfile
class Film(models.Model):
title = models.CharField(max_length=128, unique=True)
description = models.TextField()
audience = models.ManyToManyField('authapp.UserProfile', related_name='audience')
is_act... | true | true |
1c2eceafcca534e953adf57c5c2827527a921f25 | 3,936 | py | Python | data/scripts/make_aga_db.py | flovo/goratings | 50b5443b73daae64306e256205eabee8f4815c65 | [
"MIT"
] | 13 | 2020-07-02T16:43:12.000Z | 2021-12-12T00:12:48.000Z | data/scripts/make_aga_db.py | flovo/goratings | 50b5443b73daae64306e256205eabee8f4815c65 | [
"MIT"
] | 13 | 2020-07-05T10:06:42.000Z | 2022-02-27T10:03:24.000Z | data/scripts/make_aga_db.py | flovo/goratings | 50b5443b73daae64306e256205eabee8f4815c65 | [
"MIT"
] | 2 | 2020-07-04T11:19:37.000Z | 2021-01-15T16:46:32.000Z | #!/usr/bin/env pypy3
import csv
import gzip
import json
import sqlite3
import sys
from collections import defaultdict
from math import isnan
from dateutil import parser
AGA_OFFSET = 2000000000
"""
SELECT
0 `Game_ID`,
1 `Tournament_Code`,
2 `Game_Date`,
3 `Round`,
4 `Pin_Player_1`,
5 `Color_1`,
6 `Rank_1`,
7 ... | 18.222222 | 113 | 0.559705 |
import csv
import gzip
import json
import sqlite3
import sys
from collections import defaultdict
from math import isnan
from dateutil import parser
AGA_OFFSET = 2000000000
conn = sqlite3.connect("aga-data.db")
c = conn.cursor()
c.execute("DROP TABLE IF EXISTS game_records")
c.execute(
"""
CREATE TABLE IF... | true | true |
1c2ed0aa04526ddcb2922cc6b0d30d24707b557f | 1,396 | py | Python | ciphers/transposition_cipher.py | KirilBangachev/Python | 7ad45a46e02edda86a45969de8768f26ef44b306 | [
"MIT"
] | 6 | 2019-03-30T14:09:34.000Z | 2020-07-26T02:45:22.000Z | ciphers/transposition_cipher.py | KirilBangachev/Python | 7ad45a46e02edda86a45969de8768f26ef44b306 | [
"MIT"
] | 1 | 2019-09-01T06:43:06.000Z | 2019-09-01T06:44:55.000Z | ciphers/transposition_cipher.py | KirilBangachev/Python | 7ad45a46e02edda86a45969de8768f26ef44b306 | [
"MIT"
] | 7 | 2018-11-26T05:48:16.000Z | 2021-05-15T17:12:08.000Z | import math
def main():
message = input('Enter message: ')
key = int(input('Enter key [2-%s]: ' % (len(message) - 1)))
mode = input('Encryption/Decryption [e/d]: ')
if mode.lower().startswith('e'):
text = encryptMessage(key, message)
elif mode.lower().startswith('d'):
text = decryp... | 25.851852 | 90 | 0.567335 | import math
def main():
message = input('Enter message: ')
key = int(input('Enter key [2-%s]: ' % (len(message) - 1)))
mode = input('Encryption/Decryption [e/d]: ')
if mode.lower().startswith('e'):
text = encryptMessage(key, message)
elif mode.lower().startswith('d'):
text = decryp... | true | true |
1c2ed0f7dd19b2b52848f7ccb350aac69ffa9104 | 1,606 | py | Python | tests/menu_test_9.py | sourcery-ai-bot/Qprompt | baa4810d7a2db450c659983179ff051706b6dadd | [
"MIT"
] | 49 | 2017-01-20T04:57:27.000Z | 2022-01-11T17:35:45.000Z | tests/menu_test_9.py | sourcery-ai-bot/Qprompt | baa4810d7a2db450c659983179ff051706b6dadd | [
"MIT"
] | 14 | 2016-02-19T05:53:12.000Z | 2020-01-11T16:08:16.000Z | tests/menu_test_9.py | sourcery-ai-bot/Qprompt | baa4810d7a2db450c659983179ff051706b6dadd | [
"MIT"
] | 7 | 2018-06-16T14:30:26.000Z | 2020-06-03T23:28:14.000Z | """Tests menu 'result' option return."""
##==============================================================#
## SECTION: Imports #
##==============================================================#
from testlib import *
from qprompt import Menu
##============================... | 26.766667 | 65 | 0.339352 |
lf.menu.main(loop=True)
self.assertEqual(2, TOTAL)
def inc():
global TOTAL
TOTAL += 1
def dec():
global TOTAL
TOTAL -= 1
| true | true |
1c2ed11906e34fdfd3a4357898cc9db0b3e19171 | 11,105 | py | Python | octavia/amphorae/backends/agent/api_server/plug.py | zjchao/octavia | e07031fa78604568c6e2112cb4cb147661bc57d7 | [
"Apache-2.0"
] | null | null | null | octavia/amphorae/backends/agent/api_server/plug.py | zjchao/octavia | e07031fa78604568c6e2112cb4cb147661bc57d7 | [
"Apache-2.0"
] | null | null | null | octavia/amphorae/backends/agent/api_server/plug.py | zjchao/octavia | e07031fa78604568c6e2112cb4cb147661bc57d7 | [
"Apache-2.0"
] | null | null | null | # Copyright 2015 Hewlett-Packard Development Company, L.P.
# Copyright 2016 Rackspace
#
# 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... | 41.12963 | 79 | 0.622242 |
import ipaddress
import os
import socket
import stat
import subprocess
import jinja2
from oslo_config import cfg
from oslo_log import log as logging
import pyroute2
import six
import webob
from werkzeug import exceptions
import netifaces
from octavia.common import constants as consts
CONF = cfg.CONF
... | true | true |
1c2ed1198a770c6d0b0fcfb644dd93fa1250cc4c | 1,382 | py | Python | imgdata.py | DrNH4CK3R/Img-Forensic | 223c0fe37735a30b18b626e894a5aff384a60e37 | [
"MIT"
] | 1 | 2021-09-23T05:38:32.000Z | 2021-09-23T05:38:32.000Z | imgdata.py | DrNH4CK3R/Img-Forensic | 223c0fe37735a30b18b626e894a5aff384a60e37 | [
"MIT"
] | null | null | null | imgdata.py | DrNH4CK3R/Img-Forensic | 223c0fe37735a30b18b626e894a5aff384a60e37 | [
"MIT"
] | null | null | null |
from PIL import Image
from PIL.ExifTags import TAGS
import os
import sys
import time
lgreen = '\033[92m'
cyan = '\033[96m'
bold = '\033[01m'
red = '\033[31m'
os.system("clear")
print(bold+red+"""
___ ____ _
|_ _|_ __ ___ __ _ | _ \ __ _| |_ __ _
| || '_ ` ... | 21.59375 | 69 | 0.471056 |
from PIL import Image
from PIL.ExifTags import TAGS
import os
import sys
import time
lgreen = '\033[92m'
cyan = '\033[96m'
bold = '\033[01m'
red = '\033[31m'
os.system("clear")
print(bold+red+"""
___ ____ _
|_ _|_ __ ___ __ _ | _ \ __ _| |_ __ _
| || '_ ` ... | true | true |
1c2ed220c9c1e6a8dc2d7c4db9055675dd77049b | 4,607 | py | Python | django/contrib/auth/management/__init__.py | kkoralsky/django | 924af638e4d4fb8eb46a19ac0cafcb2e83480cf3 | [
"PSF-2.0",
"BSD-3-Clause"
] | null | null | null | django/contrib/auth/management/__init__.py | kkoralsky/django | 924af638e4d4fb8eb46a19ac0cafcb2e83480cf3 | [
"PSF-2.0",
"BSD-3-Clause"
] | null | null | null | django/contrib/auth/management/__init__.py | kkoralsky/django | 924af638e4d4fb8eb46a19ac0cafcb2e83480cf3 | [
"PSF-2.0",
"BSD-3-Clause"
] | 1 | 2020-02-06T10:31:51.000Z | 2020-02-06T10:31:51.000Z | """
Creates permissions for all installed apps that need permissions.
"""
import getpass
import unicodedata
from django.apps import apps as global_apps
from django.contrib.auth import get_permission_codename
from django.core import exceptions
from django.db import DEFAULT_DB_ALIAS, router
def _get_all_permissions(op... | 32.443662 | 118 | 0.666594 | import getpass
import unicodedata
from django.apps import apps as global_apps
from django.contrib.auth import get_permission_codename
from django.core import exceptions
from django.db import DEFAULT_DB_ALIAS, router
def _get_all_permissions(opts):
builtin = _get_builtin_permissions(opts)
custom = list(opts.p... | true | true |
1c2ed251c6ebe0f19446db9655fb31fc40f8030c | 2,927 | py | Python | ci/create_codewind_index.py | josiemundi/stacks | e9e90a93d17a2719e9f26ee7cac05abe697fddd7 | [
"Apache-2.0"
] | 96 | 2019-06-19T14:47:05.000Z | 2022-02-20T09:31:14.000Z | ci/create_codewind_index.py | josiemundi/stacks | e9e90a93d17a2719e9f26ee7cac05abe697fddd7 | [
"Apache-2.0"
] | 591 | 2019-06-24T20:49:42.000Z | 2022-02-20T12:26:28.000Z | ci/create_codewind_index.py | josiemundi/stacks | e9e90a93d17a2719e9f26ee7cac05abe697fddd7 | [
"Apache-2.0"
] | 127 | 2019-06-21T10:02:15.000Z | 2021-08-10T11:55:18.000Z | #!/usr/bin/env python3
import yaml
import json
import os
import fnmatch
from collections import OrderedDict
import argparse
from argparse import ArgumentDefaultsHelpFormatter
parser = argparse.ArgumentParser(formatter_class=ArgumentDefaultsHelpFormatter)
parser.add_argument("-n", "--namePrefix", help="Display name p... | 41.814286 | 143 | 0.460198 |
import yaml
import json
import os
import fnmatch
from collections import OrderedDict
import argparse
from argparse import ArgumentDefaultsHelpFormatter
parser = argparse.ArgumentParser(formatter_class=ArgumentDefaultsHelpFormatter)
parser.add_argument("-n", "--namePrefix", help="Display name prefix.", default="Apps... | true | true |
1c2ed2577fc97422b4a279da2c5778ffedaef873 | 2,333 | py | Python | PAMT.py | PuffinDev/PAMT | a398e049c40920e58cebc0c502f1e7020aa82d04 | [
"MIT"
] | null | null | null | PAMT.py | PuffinDev/PAMT | a398e049c40920e58cebc0c502f1e7020aa82d04 | [
"MIT"
] | null | null | null | PAMT.py | PuffinDev/PAMT | a398e049c40920e58cebc0c502f1e7020aa82d04 | [
"MIT"
] | null | null | null | import sys
import os
import time
import json
import fnmatch
from progress.bar import Bar
# Python Anti-Malware Toolkit
root = "/" #'/' for linux 'C:\' for windows
patterns = ['*.py', '*.sh']
matching_files = []
dangerous_files = []
bad_content = b'rm -rf' #Files that contain this text will be blacklisted
banner =... | 25.922222 | 104 | 0.520789 | import sys
import os
import time
import json
import fnmatch
from progress.bar import Bar
root = "/"
patterns = ['*.py', '*.sh']
matching_files = []
dangerous_files = []
bad_content = b'rm -rf'
banner = \
'\u001b[34;1m' + """
-------------------------------
| __ \ /\ | \/ |__ __|
| |__) / \ | \ / | ... | true | true |
1c2ed25db044f12f0682b55f85596a61dca543f5 | 8,696 | py | Python | src/ebay_rest/api/sell_account/models/fulfillment_policy_response.py | matecsaj/ebay_rest | dd23236f39e05636eff222f99df1e3699ce47d4a | [
"MIT"
] | 3 | 2021-12-12T04:28:03.000Z | 2022-03-10T03:29:18.000Z | src/ebay_rest/api/sell_account/models/fulfillment_policy_response.py | jdavv/ebay_rest | 20fc88c6aefdae9ab90f9c1330e79abddcd750cd | [
"MIT"
] | 33 | 2021-06-16T20:44:36.000Z | 2022-03-30T14:55:06.000Z | src/ebay_rest/api/sell_account/models/fulfillment_policy_response.py | jdavv/ebay_rest | 20fc88c6aefdae9ab90f9c1330e79abddcd750cd | [
"MIT"
] | 7 | 2021-06-03T09:30:23.000Z | 2022-03-08T19:51:33.000Z | # coding: utf-8
"""
Account API
The <b>Account API</b> gives sellers the ability to configure their eBay seller accounts, including the seller's policies (seller-defined custom policies and eBay business policies), opt in and out of eBay seller programs, configure sales tax tables, and get account information... | 30.946619 | 479 | 0.598436 |
import pprint
import re
import six
class FulfillmentPolicyResponse(object):
swagger_types = {
'fulfillment_policies': 'list[FulfillmentPolicy]',
'href': 'str',
'limit': 'int',
'next': 'str',
'offset': 'int',
'prev': 'str',
'total': 'int'
}
attr... | true | true |
1c2ed28d9edb990dad0e6868305d0ddaf594099a | 846 | py | Python | 02.translate-bots/kakao_bot.1.py | TTEarth/chatbothon | 091ab78e8fce3dd942cf4e829f198f70a835380f | [
"Apache-2.0"
] | 1 | 2018-11-25T01:46:30.000Z | 2018-11-25T01:46:30.000Z | 02.translate-bots/kakao_bot.1.py | TTEarth/chatbothon | 091ab78e8fce3dd942cf4e829f198f70a835380f | [
"Apache-2.0"
] | null | null | null | 02.translate-bots/kakao_bot.1.py | TTEarth/chatbothon | 091ab78e8fce3dd942cf4e829f198f70a835380f | [
"Apache-2.0"
] | 2 | 2018-11-18T02:49:16.000Z | 2018-11-25T03:05:17.000Z | # -*- coding: utf-8 -*-
from flask import Flask
from flask import request
from flask import jsonify
from flask import json
from googletrans import Translator
app = Flask(__name__)
@app.route("/keyboard")
def keyboard():
return jsonify(type="text")
@app.route("/message", methods=["POST"])
def message():
data... | 22.864865 | 67 | 0.635934 |
from flask import Flask
from flask import request
from flask import jsonify
from flask import json
from googletrans import Translator
app = Flask(__name__)
@app.route("/keyboard")
def keyboard():
return jsonify(type="text")
@app.route("/message", methods=["POST"])
def message():
data = json.loads(request.d... | true | true |
1c2ed813675282f66b63170ef08fc72abf9aefb4 | 53,809 | py | Python | tensorflow/python/keras/callbacks.py | takafreak/tensorflow | b85cb440e257a367fb70f8321ddaa669d1bd9fae | [
"Apache-2.0"
] | 2 | 2020-12-06T02:26:32.000Z | 2021-08-20T03:40:32.000Z | tensorflow/python/keras/callbacks.py | takafreak/tensorflow | b85cb440e257a367fb70f8321ddaa669d1bd9fae | [
"Apache-2.0"
] | null | null | null | tensorflow/python/keras/callbacks.py | takafreak/tensorflow | b85cb440e257a367fb70f8321ddaa669d1bd9fae | [
"Apache-2.0"
] | null | null | null | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 34.648422 | 80 | 0.657344 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
import copy
import csv
import io
import json
import os
import time
import numpy as np
import six
from tensorflow.python.data.ops import iterator_ops
from tensorflow.python.ea... | true | true |
1c2ed867e0956d8de08780e0ee8cf45c04524811 | 4,788 | py | Python | opsgenie_swagger/models/list_user_forwarding_rules_response.py | Logicworks/opsgenie-python-sdk | 244c4c40ddcc25e70df5ba4425ab8d7c8da59c18 | [
"Apache-2.0"
] | null | null | null | opsgenie_swagger/models/list_user_forwarding_rules_response.py | Logicworks/opsgenie-python-sdk | 244c4c40ddcc25e70df5ba4425ab8d7c8da59c18 | [
"Apache-2.0"
] | null | null | null | opsgenie_swagger/models/list_user_forwarding_rules_response.py | Logicworks/opsgenie-python-sdk | 244c4c40ddcc25e70df5ba4425ab8d7c8da59c18 | [
"Apache-2.0"
] | 1 | 2020-11-07T11:27:13.000Z | 2020-11-07T11:27:13.000Z | # coding: utf-8
"""
OpsGenie REST API
OpsGenie OpenAPI Specification # noqa: E501
OpenAPI spec version: 2.0.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
from opsgenie_swagger.models.base_response import BaseResponse ... | 28.164706 | 96 | 0.591061 |
import pprint
import re
import six
from opsgenie_swagger.models.base_response import BaseResponse
from opsgenie_swagger.models.forwarding_rule import ForwardingRule
class ListUserForwardingRulesResponse(object):
swagger_types = {
'request_id': 'str',
'took': 'float',
'data': '... | true | true |
1c2ed9606f75c5dc16def840ff41f8e1d5d88501 | 26,633 | py | Python | train_acne.py | wenh06/yolov4_acne_torch | 8eda65ff6805ec313de39c74aea12a774657f3ff | [
"Apache-2.0"
] | null | null | null | train_acne.py | wenh06/yolov4_acne_torch | 8eda65ff6805ec313de39c74aea12a774657f3ff | [
"Apache-2.0"
] | null | null | null | train_acne.py | wenh06/yolov4_acne_torch | 8eda65ff6805ec313de39c74aea12a774657f3ff | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
'''
train acne detector using the enhanced ACNE04 dataset
More reference:
[1] https://pytorch.org/tutorials/intermediate/torchvision_tutorial.html
'''
import time
import logging
import os, sys
import argparse
from collections import deque
import datetime
import cv2
from tqdm import tqdm
import... | 40.475684 | 274 | 0.578943 |
import time
import logging
import os, sys
import argparse
from collections import deque
import datetime
import cv2
from tqdm import tqdm
import numpy as np
import torch
import torch.nn as nn
from torch.utils.data import DataLoader
from torch import optim
from torch.nn import functional as F
from tensorboardX import S... | true | true |
1c2ed974fbbbbb2a48514a7e2f63e0a2bfa50dd4 | 5,532 | py | Python | mayan/apps/events/apps.py | CMU-313/fall-2021-hw2-451-unavailable-for-legal-reasons | 0e4e919fd2e1ded6711354a0330135283e87f8c7 | [
"Apache-2.0"
] | 2 | 2021-09-12T19:41:19.000Z | 2021-09-12T19:41:20.000Z | mayan/apps/events/apps.py | CMU-313/fall-2021-hw2-451-unavailable-for-legal-reasons | 0e4e919fd2e1ded6711354a0330135283e87f8c7 | [
"Apache-2.0"
] | 37 | 2021-09-13T01:00:12.000Z | 2021-10-02T03:54:30.000Z | mayan/apps/events/apps.py | CMU-313/fall-2021-hw2-451-unavailable-for-legal-reasons | 0e4e919fd2e1ded6711354a0330135283e87f8c7 | [
"Apache-2.0"
] | 1 | 2021-09-22T13:17:30.000Z | 2021-09-22T13:17:30.000Z | from django.apps import apps
from django.db import models
from django.utils.translation import ugettext_lazy as _
from mayan.apps.acls.classes import ModelPermission
from mayan.apps.common.apps import MayanAppConfig
from mayan.apps.common.menus import (
menu_object, menu_secondary, menu_tools, menu_topbar, ... | 37.378378 | 80 | 0.618764 | from django.apps import apps
from django.db import models
from django.utils.translation import ugettext_lazy as _
from mayan.apps.acls.classes import ModelPermission
from mayan.apps.common.apps import MayanAppConfig
from mayan.apps.common.menus import (
menu_object, menu_secondary, menu_tools, menu_topbar, ... | true | true |
1c2edb084a5b7ee65534fb4e2d94be0da9da3cb1 | 3,772 | py | Python | neutron/tests/unit/plugins/ml2/drivers/openvswitch/mech_driver/test_mech_openvswitch.py | freyes/neutron | 197c222acb0390728106a083d1663f2c06427518 | [
"Apache-2.0"
] | null | null | null | neutron/tests/unit/plugins/ml2/drivers/openvswitch/mech_driver/test_mech_openvswitch.py | freyes/neutron | 197c222acb0390728106a083d1663f2c06427518 | [
"Apache-2.0"
] | null | null | null | neutron/tests/unit/plugins/ml2/drivers/openvswitch/mech_driver/test_mech_openvswitch.py | freyes/neutron | 197c222acb0390728106a083d1663f2c06427518 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2013 OpenStack Foundation
# 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 ... | 36.621359 | 78 | 0.66702 |
from neutron_lib import constants
from oslo_config import cfg
from neutron.extensions import portbindings
from neutron.plugins.ml2.drivers.openvswitch.mech_driver \
import mech_openvswitch
from neutron.tests.unit.plugins.ml2 import _test_mech_agent as base
class OpenvswitchMechanismBaseTestCase(ba... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.