hexsha stringlengths 40 40 | size int64 3 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 972 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 78 | 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 3 972 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 3 972 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 3 1.03M | avg_line_length float64 1.13 941k | max_line_length int64 2 941k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f1eb050f5f78a88cdcb901e8404776450cbd1dd6 | 1,131 | py | Python | app_venv/Lib/site-packages/phonenumbers/data/region_QA.py | orlandofv/sianna | f07dd6dbc62a9604f31ab800e482e62f14fba766 | [
"MIT"
] | null | null | null | app_venv/Lib/site-packages/phonenumbers/data/region_QA.py | orlandofv/sianna | f07dd6dbc62a9604f31ab800e482e62f14fba766 | [
"MIT"
] | null | null | null | app_venv/Lib/site-packages/phonenumbers/data/region_QA.py | orlandofv/sianna | f07dd6dbc62a9604f31ab800e482e62f14fba766 | [
"MIT"
] | null | null | null | """Auto-generated file, do not edit by hand. QA metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_QA = PhoneMetadata(id='QA', country_code=974, international_prefix='00',
general_desc=PhoneNumberDesc(national_number_pattern='[2-7]\\d{7}|800\\d{4}(?:\\d{2})?|2\\d{6}... | 87 | 137 | 0.695844 |
62b3398585bb7fef71d09b4a2e397e97e51ecc0e | 344 | py | Python | slider.py | RyderTheCoder/gui-learning | d92636fe4c31bdfd8752ccdd3a3f1dd3e9edb2cd | [
"Unlicense"
] | null | null | null | slider.py | RyderTheCoder/gui-learning | d92636fe4c31bdfd8752ccdd3a3f1dd3e9edb2cd | [
"Unlicense"
] | null | null | null | slider.py | RyderTheCoder/gui-learning | d92636fe4c31bdfd8752ccdd3a3f1dd3e9edb2cd | [
"Unlicense"
] | null | null | null | from Tkinter import *
def sel():
selection = "Value = " + str(var.get())
label.config(text = selection)
root = Tk()
var = DoubleVar()
scale = Scale( root, variable = var )
scale.pack(anchor=CENTER)
button = Button(root, text="Get Scale Value", command=sel)
button.pack(anchor=CENTER)
label = Label(root)
label.p... | 18.105263 | 58 | 0.680233 |
096f60818786251bd1817e13a1958f2915d6b642 | 87 | py | Python | conf.py | ziozzang/clair-generic-scanner | f7ea4c67cfa13af751bb79d241a5ae2b19edcc50 | [
"BSD-2-Clause"
] | null | null | null | conf.py | ziozzang/clair-generic-scanner | f7ea4c67cfa13af751bb79d241a5ae2b19edcc50 | [
"BSD-2-Clause"
] | null | null | null | conf.py | ziozzang/clair-generic-scanner | f7ea4c67cfa13af751bb79d241a5ae2b19edcc50 | [
"BSD-2-Clause"
] | null | null | null | DB_IP='pgsql'
DB_PORT='5432'
DB_ID='postgres'
DB_PW=''
BIND_ADDR="0.0.0.0"
DEBUG=False
| 12.428571 | 19 | 0.712644 |
57d772f0eadb4e3818bfc3378535fb2ec2401aeb | 7,056 | py | Python | gtfs_data/database_test.py | seanrees/gtfs-upcoming | 76ebff4bbe1bd49bc598dfe0840792dfad500ae5 | [
"MIT"
] | 5 | 2020-09-08T20:38:46.000Z | 2022-03-31T18:24:31.000Z | gtfs_data/database_test.py | seanrees/gtfs-upcoming | 76ebff4bbe1bd49bc598dfe0840792dfad500ae5 | [
"MIT"
] | null | null | null | gtfs_data/database_test.py | seanrees/gtfs-upcoming | 76ebff4bbe1bd49bc598dfe0840792dfad500ae5 | [
"MIT"
] | 1 | 2022-03-31T18:24:32.000Z | 2022-03-31T18:24:32.000Z | import gtfs_data.database
import datetime
import unittest
TEST_FILE = 'gtfs_data/testdata/agency.txt'
GTFS_DATA = 'gtfs_data/testdata'
INTERESTING_STOPS = ['8220DB000490']
class TestDatabase(unittest.TestCase):
def setUp(self):
self.database = gtfs_data.database.Database(GTFS_DATA, INTERESTING_STOPS)
def t... | 36.371134 | 92 | 0.68013 |
4dfb786d497ae53ffc6e76a24bd7f6b32676cdf0 | 12,565 | py | Python | pysnmp/Wellfleet-QOS-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 11 | 2021-02-02T16:27:16.000Z | 2021-08-31T06:22:49.000Z | pysnmp/Wellfleet-QOS-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 75 | 2021-02-24T17:30:31.000Z | 2021-12-08T00:01:18.000Z | pysnmp/Wellfleet-QOS-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 10 | 2019-04-30T05:51:36.000Z | 2022-02-16T03:33:41.000Z | #
# PySNMP MIB module Wellfleet-QOS-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/Wellfleet-QOS-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 21:34:47 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Ma... | 136.576087 | 1,981 | 0.771269 |
b4ed4c572c624bcede20af8b2a24eff016a690b2 | 1,372 | py | Python | 9-6.py | Holaplace/path_to_python | 8fae2aca8d6da04c39a67514948fdf50e883750a | [
"MIT"
] | 1 | 2019-02-06T01:49:18.000Z | 2019-02-06T01:49:18.000Z | 9-6.py | Holaplace/path_to_python | 8fae2aca8d6da04c39a67514948fdf50e883750a | [
"MIT"
] | null | null | null | 9-6.py | Holaplace/path_to_python | 8fae2aca8d6da04c39a67514948fdf50e883750a | [
"MIT"
] | null | null | null | class Restaurant():
def __init__(self, restaurant_name, cuisine_type):
self.restaurant_name = restaurant_name
self.cuisine_type = cuisine_type
self.count = 10
def describe_restaurant(self):
print('The restaurant name is '
+ self.restaurant_name.title()
... | 31.181818 | 85 | 0.620262 |
a9f1d66e9ad3970c857e9174aa855a587096b24c | 17,586 | py | Python | scipy/signal/tests/test_spectral.py | jiffyclub/scipy | e346aa55c0416b915148c35cc200a0ed74f85c0a | [
"BSD-3-Clause"
] | 1 | 2019-04-27T16:04:14.000Z | 2019-04-27T16:04:14.000Z | scipy/signal/tests/test_spectral.py | joferkington/scipy | 6a7327e8bb8248b2ea165180bc602edf1ab33dda | [
"BSD-3-Clause"
] | 5 | 2021-03-19T08:36:48.000Z | 2022-01-13T01:52:34.000Z | scipy/signal/tests/test_spectral.py | joferkington/scipy | 6a7327e8bb8248b2ea165180bc602edf1ab33dda | [
"BSD-3-Clause"
] | 1 | 2019-08-13T21:23:57.000Z | 2019-08-13T21:23:57.000Z | from __future__ import division, print_function, absolute_import
import warnings
import numpy as np
from numpy.testing import assert_raises, assert_approx_equal, \
assert_, run_module_suite, TestCase,\
assert_allclose, assert_array_equal,\
a... | 33.243856 | 83 | 0.551234 |
e65ca3bac939e4c922da5142173bf5d766ecc7da | 3,871 | py | Python | cnn2d_model.py | wumch/text-classification-cnn-rnn | f2b8395442d8d5e373990a6672fc665a07c3c655 | [
"MIT"
] | null | null | null | cnn2d_model.py | wumch/text-classification-cnn-rnn | f2b8395442d8d5e373990a6672fc665a07c3c655 | [
"MIT"
] | null | null | null | cnn2d_model.py | wumch/text-classification-cnn-rnn | f2b8395442d8d5e373990a6672fc665a07c3c655 | [
"MIT"
] | null | null | null |
import tensorflow as tf
import word2vec
import numpy as np
class TextCNN(object):
"""
A CNN for text classification.
Uses an embedding layer, followed by a convolutional, max-pooling and softmax layer.
"""
def __init__(
self, sequence_length, num_classes, embedding_model: word2vec.WordVec... | 43.988636 | 129 | 0.594162 |
74fc343c097e20acb922f5c9ed6bb8d5908726de | 3,736 | py | Python | python/cugraph/community/ktruss_subgraph.py | isVoid/cugraph | a39e5a3063b9ac8ee93f4cc632c59ca2613434c6 | [
"Apache-2.0"
] | null | null | null | python/cugraph/community/ktruss_subgraph.py | isVoid/cugraph | a39e5a3063b9ac8ee93f4cc632c59ca2613434c6 | [
"Apache-2.0"
] | null | null | null | python/cugraph/community/ktruss_subgraph.py | isVoid/cugraph | a39e5a3063b9ac8ee93f4cc632c59ca2613434c6 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2019-2020, NVIDIA CORPORATION.
# 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... | 38.122449 | 77 | 0.695128 |
8790436e34ffe8a9e8e7991bb3ccbe7f2e8a44bc | 2,167 | py | Python | share/qt/extract_strings_qt.py | altecoin-altc/altecoin | 913678a298eb7eb9157cd2be184b927cfbb429a9 | [
"MIT"
] | null | null | null | share/qt/extract_strings_qt.py | altecoin-altc/altecoin | 913678a298eb7eb9157cd2be184b927cfbb429a9 | [
"MIT"
] | null | null | null | share/qt/extract_strings_qt.py | altecoin-altc/altecoin | 913678a298eb7eb9157cd2be184b927cfbb429a9 | [
"MIT"
] | null | null | null | #!/usr/bin/python
'''
Extract _("...") strings for translation and convert to Qt stringdefs so that
they can be picked up by Qt linguist.
'''
from __future__ import division,print_function,unicode_literals
from subprocess import Popen, PIPE
import glob
import operator
import os
import sys
OUT_CPP="qt/altecoinstrings.c... | 25.797619 | 105 | 0.620212 |
844aa6f754096ded6b93d60cfcc27cbd7f6137a3 | 11,353 | py | Python | cryptol-remote-api/python/tests/cryptol/test_cryptol_api.py | GaloisInc/cryptol | 8b97cf4a8a16b511c52bc0664e4ee2feff3d874a | [
"BSD-3-Clause"
] | 773 | 2015-01-08T15:43:54.000Z | 2022-03-23T04:26:02.000Z | cryptol-remote-api/python/tests/cryptol/test_cryptol_api.py | GaloisInc/cryptol | 8b97cf4a8a16b511c52bc0664e4ee2feff3d874a | [
"BSD-3-Clause"
] | 1,050 | 2015-01-02T23:10:55.000Z | 2022-03-30T17:02:34.000Z | cryptol-remote-api/python/tests/cryptol/test_cryptol_api.py | GaloisInc/cryptol | 8b97cf4a8a16b511c52bc0664e4ee2feff3d874a | [
"BSD-3-Clause"
] | 117 | 2015-01-01T18:45:39.000Z | 2022-03-06T15:40:57.000Z | import unittest
from pathlib import Path
import os
from pathlib import Path
import subprocess
import time
import unittest
import signal
from distutils.spawn import find_executable
import cryptol
import argo_client.connection as argo
import cryptol.cryptoltypes
from cryptol.single_connection import *
from cryptol import... | 39.013746 | 123 | 0.588303 |
184ba6896750f2e80355b84ff3d94e42c21840f4 | 694 | py | Python | google/ads/googleads/v6/services/services/custom_interest_service/__init__.py | wxxlouisa/google-ads-python | f24137966f6bfcb765a9b1fae79f2d23041825fe | [
"Apache-2.0"
] | null | null | null | google/ads/googleads/v6/services/services/custom_interest_service/__init__.py | wxxlouisa/google-ads-python | f24137966f6bfcb765a9b1fae79f2d23041825fe | [
"Apache-2.0"
] | null | null | null | google/ads/googleads/v6/services/services/custom_interest_service/__init__.py | wxxlouisa/google-ads-python | f24137966f6bfcb765a9b1fae79f2d23041825fe | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 33.047619 | 74 | 0.756484 |
d1ed98ef77ac7262de7be0164f3180ff3867c196 | 4,910 | py | Python | docs/conf.py | yoyonel/pyDarknetServer | 51c573971a55b1b565ffab9530a4955799a81b06 | [
"MIT"
] | null | null | null | docs/conf.py | yoyonel/pyDarknetServer | 51c573971a55b1b565ffab9530a4955799a81b06 | [
"MIT"
] | 234 | 2019-07-24T05:39:34.000Z | 2022-03-28T11:38:20.000Z | docs/conf.py | yoyonel/pyDarknetServer | 51c573971a55b1b565ffab9530a4955799a81b06 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# pydarknetserver documentation build configuration file, created by
# sphinx-quickstart on Fri Jun 9 13:47:02 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in th... | 29.939024 | 77 | 0.689613 |
de9b155fe6f9c512330c0a4b86f24ead42e10845 | 116 | py | Python | homeworks/alexei_rakhmanko/hw05/level02.py | tgrx/Z22 | b2539682ff26c8b6d9f63a7670c8a9c6b614a8ff | [
"Apache-2.0"
] | null | null | null | homeworks/alexei_rakhmanko/hw05/level02.py | tgrx/Z22 | b2539682ff26c8b6d9f63a7670c8a9c6b614a8ff | [
"Apache-2.0"
] | 8 | 2019-11-15T18:15:56.000Z | 2020-02-03T18:05:05.000Z | homeworks/alexei_rakhmanko/hw05/level02.py | tgrx/Z22 | b2539682ff26c8b6d9f63a7670c8a9c6b614a8ff | [
"Apache-2.0"
] | null | null | null | """Уровень 2"""
def hello(name):
"""Функция"""
if name:
return f"Hello, {name}!"
return "Hi!"
| 12.888889 | 32 | 0.491379 |
efdf31ceebf701a22daa1e7ba81b729ad1709c35 | 8,732 | py | Python | sdk/python/pulumi_azure_native/storagesync/v20190301/get_cloud_endpoint.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/storagesync/v20190301/get_cloud_endpoint.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/storagesync/v20190301/get_cloud_endpoint.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
__... | 40.613953 | 288 | 0.682432 |
149108dd41dc2b2f850caca642970715ebf1f00a | 16,599 | py | Python | isofit/common.py | lewismc/isofit | 87fb45f76fc06e5212e0c8cdf830b996efcb2950 | [
"Apache-2.0"
] | 1 | 2020-11-05T18:11:25.000Z | 2020-11-05T18:11:25.000Z | isofit/common.py | kylepeterson777/isofit | af428c8f141141e165df66554156f9a60d9d509c | [
"Apache-2.0"
] | null | null | null | isofit/common.py | kylepeterson777/isofit | af428c8f141141e165df66554156f9a60d9d509c | [
"Apache-2.0"
] | null | null | null | #! /usr/bin/env python3
#
# Copyright 2018 California Institute of Technology
#
# 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
#
# Unle... | 35.696774 | 80 | 0.514368 |
2f3ce262ac7697f026fb33b731ef2fac10326ed0 | 1,437 | py | Python | mmedit/datasets/generation_paired_dataset.py | Yshuo-Li/mmediting-test | ff8349a183b3d266495a53be0c8ad8e342e8b461 | [
"Apache-2.0"
] | 2 | 2021-04-20T11:31:37.000Z | 2021-05-27T13:04:40.000Z | mmedit/datasets/generation_paired_dataset.py | Yshuo-Li/mmediting-test | ff8349a183b3d266495a53be0c8ad8e342e8b461 | [
"Apache-2.0"
] | 1 | 2021-08-05T16:20:39.000Z | 2021-08-05T16:20:39.000Z | mmedit/datasets/generation_paired_dataset.py | Yshuo-Li/mmediting-test | ff8349a183b3d266495a53be0c8ad8e342e8b461 | [
"Apache-2.0"
] | 2 | 2021-04-22T12:10:14.000Z | 2021-05-19T02:09:48.000Z | import os.path as osp
from .base_generation_dataset import BaseGenerationDataset
from .registry import DATASETS
@DATASETS.register_module()
class GenerationPairedDataset(BaseGenerationDataset):
"""General paired image folder dataset for image generation.
It assumes that the training directory is '/path/to/d... | 35.04878 | 79 | 0.675017 |
ca6919f85e37d6b4876ff73f68873802ca08b052 | 746 | py | Python | example.py | maxir143/GPEmu | 7ce724b65f4e1f298cc4d0e942892154d252e208 | [
"MIT"
] | null | null | null | example.py | maxir143/GPEmu | 7ce724b65f4e1f298cc4d0e942892154d252e208 | [
"MIT"
] | null | null | null | example.py | maxir143/GPEmu | 7ce724b65f4e1f298cc4d0e942892154d252e208 | [
"MIT"
] | null | null | null | from GPEmu import GamePad
def main():
# create game pad
gamepad = GamePad()
# start game pad
gamepad.connect()
# check if 'RT' is a trigger
if 'RT' in gamepad.triggers:
# set the trigger <'RT'> to <0.5> and update is <true> (so, don't need to call GamePad.update() later)
gamep... | 25.724138 | 110 | 0.630027 |
9cac023edd8a8231906a54ad0ff12c0dd521a695 | 3,823 | py | Python | watchman/integration/test_wm_wait.py | kabat87/watchman | 6cab7e98f70722e9d635086596d543c0e1875e28 | [
"MIT"
] | null | null | null | watchman/integration/test_wm_wait.py | kabat87/watchman | 6cab7e98f70722e9d635086596d543c0e1875e28 | [
"MIT"
] | null | null | null | watchman/integration/test_wm_wait.py | kabat87/watchman | 6cab7e98f70722e9d635086596d543c0e1875e28 | [
"MIT"
] | null | null | null | # Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import os
import subprocess
import sys
from watchman.integration.lib import WatchmanInstance
from watchman.integration.lib import Watchman... | 33.831858 | 85 | 0.618886 |
64524685594673bfe5f52bfb1a755d6b1ab20e00 | 5,040 | py | Python | mapping/star/discretized_bath/asymmetric_mean.py | fhoeb/py-mapping | daf37f522f8acb6af2285d44f39cab31f34b01a4 | [
"BSD-3-Clause"
] | 1 | 2021-01-18T00:02:40.000Z | 2021-01-18T00:02:40.000Z | mapping/star/discretized_bath/asymmetric_mean.py | fhoeb/py-mapping | daf37f522f8acb6af2285d44f39cab31f34b01a4 | [
"BSD-3-Clause"
] | null | null | null | mapping/star/discretized_bath/asymmetric_mean.py | fhoeb/py-mapping | daf37f522f8acb6af2285d44f39cab31f34b01a4 | [
"BSD-3-Clause"
] | 3 | 2021-01-18T00:12:41.000Z | 2021-07-05T15:28:33.000Z | """
Discretized bath for the generation of direct asymmetric discretization coefficients, where the integrals for
the couplings and energies are evaluated using a heuristic method called mean discretization.
Introduced in: de Vega et al., Phys. Rev. B 92, 155126 (2015)
"""
import numpy as np
from scipy.int... | 51.958763 | 120 | 0.63869 |
457818dee737a765581ca4fcc7566217fbdae1d8 | 1,505 | py | Python | app/version1/users/validator.py | SimonAwiti/sentIT-endpoints | 914b5cba4b82442cc7a9a01adaee321948d6abfa | [
"MIT"
] | null | null | null | app/version1/users/validator.py | SimonAwiti/sentIT-endpoints | 914b5cba4b82442cc7a9a01adaee321948d6abfa | [
"MIT"
] | null | null | null | app/version1/users/validator.py | SimonAwiti/sentIT-endpoints | 914b5cba4b82442cc7a9a01adaee321948d6abfa | [
"MIT"
] | null | null | null | def validate_data_signup(data):
"""validate user details"""
try:
# check if password has spaces
if " " in data["password"]:
return "password should be one word, no spaces"
# check if password is empty
elif data["password"] == "":
return "password required"... | 35 | 69 | 0.55814 |
5b264e2d65085ec561b2ca89e1ce74aacdb5e4e3 | 45,337 | py | Python | video_3D_alg/video_draft.py | landdafku11/CogAlg | b33d706b25f63d5a2a4bbf9bb6a5d1fad5b9b5eb | [
"MIT"
] | 102 | 2016-10-09T01:33:00.000Z | 2022-01-28T01:03:23.000Z | video_3D_alg/video_draft.py | Risingabhi/CogAlg | a95ea498af3104893f92028f466a56ef3a211f10 | [
"MIT"
] | 41 | 2017-06-04T16:09:43.000Z | 2022-01-20T21:11:42.000Z | video_3D_alg/video_draft.py | Risingabhi/CogAlg | a95ea498af3104893f92028f466a56ef3a211f10 | [
"MIT"
] | 50 | 2017-05-10T06:25:36.000Z | 2021-08-02T20:28:54.000Z | import os
import cv2
import argparse
import numpy as np
from scipy import misc
from time import time
from collections import deque
''' Temporal blob composition over a sequence of frames in a video:
pixels are compared to rng adjacent pixels over lateral x, vertical y, temporal t coordinates,
then resulting 3... | 50.318535 | 149 | 0.56852 |
48e89d800b4d9c51db8ae2e94a990b68fedcdec8 | 286 | py | Python | Ejemplo7.py | batzzinga/Curso-Python | b9abd5d0d2625e5f64a4ea3f8c7540a9f42d2b63 | [
"MIT"
] | null | null | null | Ejemplo7.py | batzzinga/Curso-Python | b9abd5d0d2625e5f64a4ea3f8c7540a9f42d2b63 | [
"MIT"
] | null | null | null | Ejemplo7.py | batzzinga/Curso-Python | b9abd5d0d2625e5f64a4ea3f8c7540a9f42d2b63 | [
"MIT"
] | null | null | null | #! /usr/bin/python
# -*- coding iso-8859-15
#Lanzar dados y que muestre los resultados hasta que salga 3
from random import randint
n = int(input("Ingrese la cantidad de lanzamientos: "))
x = 0
for i in range(n):
x = randint(1,6)
print (x)
if x == 3:
break | 26 | 61 | 0.622378 |
1790571a81eb1297ac04a00459a856f1ffcc5f6e | 9,651 | py | Python | docs/conf.py | davidemoro/pytest-pypom-navigation | 3af2e264d2b52aa234f4962a903ea7b860a70404 | [
"Apache-2.0"
] | 2 | 2017-06-01T20:18:20.000Z | 2017-06-13T19:18:19.000Z | docs/conf.py | tierratelematics/pytest-pypom-navigation | 3af2e264d2b52aa234f4962a903ea7b860a70404 | [
"Apache-2.0"
] | 13 | 2017-05-30T08:02:58.000Z | 2018-04-01T21:16:31.000Z | docs/conf.py | davidemoro/pytest-pypom-navigation | 3af2e264d2b52aa234f4962a903ea7b860a70404 | [
"Apache-2.0"
] | 1 | 2017-10-10T11:04:35.000Z | 2017-10-10T11:04:35.000Z | # -*- coding: utf-8 -*-
#
# pytest-pypom-navigation documentation build configuration file, created by
# sphinx-quickstart on Thu Oct 1 00:43:18 2015.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogener... | 32.60473 | 79 | 0.711947 |
f9cf7e79d705c7085423242ec77f7a0ab5daa235 | 734 | py | Python | src/mahjong.py | LittleYe233/majhong-connect | 0ba711852ba7e0d5a54f346cfb606da7223f2972 | [
"Apache-2.0"
] | null | null | null | src/mahjong.py | LittleYe233/majhong-connect | 0ba711852ba7e0d5a54f346cfb606da7223f2972 | [
"Apache-2.0"
] | null | null | null | src/mahjong.py | LittleYe233/majhong-connect | 0ba711852ba7e0d5a54f346cfb606da7223f2972 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from src.utils.cardsys import Card, Cardset
from src.profiles import japanese
from src.profiles import competition
# Constants
_MJ_GAME_PROFILE_KEYS = [
'japanese', # Japanese Mahjong, 日本麻将
'competition' # Mahjong Competition Rules, 国标麻将
]
_MJ_GAME_PROFILES = { # TODO: additional... | 25.310345 | 70 | 0.667575 |
91bd8babbb751909dcfacbba1ae9f0bb75659a6a | 5,218 | py | Python | src/garage/experiment/meta_evaluator.py | bainro/garage | c5afbb19524792d9bbad9b9741f45e1d48ddca3d | [
"MIT"
] | null | null | null | src/garage/experiment/meta_evaluator.py | bainro/garage | c5afbb19524792d9bbad9b9741f45e1d48ddca3d | [
"MIT"
] | null | null | null | src/garage/experiment/meta_evaluator.py | bainro/garage | c5afbb19524792d9bbad9b9741f45e1d48ddca3d | [
"MIT"
] | null | null | null | """Evaluator which tests Meta-RL algorithms on test environments."""
from dowel import logger, tabular
from garage import log_multitask_performance, TrajectoryBatch
from garage.experiment.deterministic import get_seed
from garage.sampler import LocalSampler
from garage.sampler.worker import DefaultWorker
from garage.... | 43.848739 | 79 | 0.629743 |
aaa2f0004cfe4fe02a2257b48ce6ded479166259 | 2,281 | py | Python | tests/unit/grains/test_nvme.py | byteskeptical/salt | 637fe0b04f38b2274191b005d73b3c6707d7f400 | [
"Apache-2.0"
] | 5 | 2017-02-07T05:39:29.000Z | 2020-06-13T02:07:33.000Z | tests/unit/grains/test_nvme.py | byteskeptical/salt | 637fe0b04f38b2274191b005d73b3c6707d7f400 | [
"Apache-2.0"
] | 86 | 2017-01-27T11:54:46.000Z | 2020-05-20T06:25:26.000Z | tests/unit/grains/test_nvme.py | byteskeptical/salt | 637fe0b04f38b2274191b005d73b3c6707d7f400 | [
"Apache-2.0"
] | 11 | 2017-01-26T19:36:29.000Z | 2021-12-11T07:54:16.000Z | # -*- coding: utf-8 -*-
'''
:codeauthor: :email:`Simon Dodsley <simon@purestorage.com>`
'''
# Import Python libs
from __future__ import absolute_import, print_function, unicode_literals
import errno
import textwrap
# Import Salt Testing Libs
from tests.support.unit import TestCase, skipIf
from tests.support.mock i... | 33.544118 | 107 | 0.642701 |
6e3efd03489a4c9936edd60688e9e7d427607877 | 902 | py | Python | tests/distance_matrix.py | jni/microscopium | b9cddd8ef5f3003a396ace602228651b3020c4a3 | [
"BSD-3-Clause"
] | 53 | 2016-08-30T09:45:12.000Z | 2022-02-03T06:22:50.000Z | tests/distance_matrix.py | jni/microscopium | b9cddd8ef5f3003a396ace602228651b3020c4a3 | [
"BSD-3-Clause"
] | 151 | 2015-01-15T06:16:27.000Z | 2021-03-22T01:01:26.000Z | tests/distance_matrix.py | jni/microscopium | b9cddd8ef5f3003a396ace602228651b3020c4a3 | [
"BSD-3-Clause"
] | 19 | 2015-01-15T06:13:26.000Z | 2021-09-13T13:06:47.000Z | """Generate pre-computed distance matrix for Euclidean distance.
"""
import os
from numpy import sqrt
import pandas as pd
import numpy as np
abspath = os.path.dirname(__file__)
def string2tuple(string_tuple):
# TODO add docstring
string_values = string_tuple.split(', ')
coords = (int(string_values[0][1:])... | 28.1875 | 98 | 0.689579 |
2bb10e4f967f8db94aac12e6a82f5f5523ad56db | 9,045 | py | Python | sdk/python/pulumi_azure_nextgen/network/v20170301/route_table.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_nextgen/network/v20170301/route_table.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_nextgen/network/v20170301/route_table.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from... | 52.283237 | 2,301 | 0.674627 |
0aa089b2b4b94b22d0347b5b56b33783c263a4df | 9,344 | py | Python | src/sdk/pynni/nni/nas/pytorch/enas/trainer.py | struss/nni | 2e84b445125aa2365eb5e79c94287d869db3366d | [
"MIT"
] | 2 | 2020-04-19T15:57:46.000Z | 2020-04-28T18:14:19.000Z | src/sdk/pynni/nni/nas/pytorch/enas/trainer.py | arita37/nni | d51d755e2a591a166d2a8669e592da4d2c704ad6 | [
"MIT"
] | null | null | null | src/sdk/pynni/nni/nas/pytorch/enas/trainer.py | arita37/nni | d51d755e2a591a166d2a8669e592da4d2c704ad6 | [
"MIT"
] | null | null | null | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import logging
from itertools import cycle
import torch
import torch.nn as nn
import torch.optim as optim
from nni.nas.pytorch.trainer import Trainer
from nni.nas.pytorch.utils import AverageMeterGroup, to_device
from .mutator import EnasMutato... | 44.923077 | 130 | 0.58658 |
3cd34a21a4810b677af341bee0a6587ba7799423 | 22,773 | py | Python | utils/io_utils.py | buaaxyszgl/AISafety | b5bc52b6b9fc764c3ebb59674d3a7bd77b5646b0 | [
"MIT"
] | 32 | 2020-10-20T06:12:48.000Z | 2022-03-30T03:31:24.000Z | utils/io_utils.py | buaaxyszgl/AISafety | b5bc52b6b9fc764c3ebb59674d3a7bd77b5646b0 | [
"MIT"
] | 2 | 2021-03-24T13:54:50.000Z | 2021-10-11T13:37:31.000Z | utils/io_utils.py | buaaxyszgl/AISafety | b5bc52b6b9fc764c3ebb59674d3a7bd77b5646b0 | [
"MIT"
] | 19 | 2020-10-22T05:42:51.000Z | 2022-02-04T07:07:39.000Z | # -*- coding: utf-8 -*-
import importlib
import numpy as np
from PIL import Image
import os
import sys
import cv2
import random
import json
import string
from .file_utils import inorder_choose_data
import torch
def get_datasets_without_mask(
imgs_dir, label_dir, height, width, channels, train_test="null"
):
N... | 34.245113 | 119 | 0.580907 |
b1d0f1159ea5c84049c191f0c21de60111ea47ba | 1,889 | py | Python | api/program_routes.py | bcli4d/IDC-API | 29da3d93937d02f6d848f329dcebd2f706254f6f | [
"Apache-2.0"
] | null | null | null | api/program_routes.py | bcli4d/IDC-API | 29da3d93937d02f6d848f329dcebd2f706254f6f | [
"Apache-2.0"
] | null | null | null | api/program_routes.py | bcli4d/IDC-API | 29da3d93937d02f6d848f329dcebd2f706254f6f | [
"Apache-2.0"
] | null | null | null | #
# Copyright 2019, Institute for Systems Biology
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 30.967213 | 91 | 0.651668 |
bb33e4541f71f23193abb70070ccf4844f52845e | 901 | py | Python | ooobuild/dyn/drawing/enhanced_custom_shape_geometry.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | ooobuild/dyn/drawing/enhanced_custom_shape_geometry.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | ooobuild/dyn/drawing/enhanced_custom_shape_geometry.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
#
# Copyright 2022 :Barry-Thomas-Paul: Moss
#
# 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... | 34.653846 | 115 | 0.773585 |
be7a73f8081e938d0b6258f2b1ba9d49ea027139 | 876 | py | Python | collect_world.py | Slauva/robot_shop | 7d0556cf4c614b3f991f334ed3a1016a89acd339 | [
"MIT"
] | null | null | null | collect_world.py | Slauva/robot_shop | 7d0556cf4c614b3f991f334ed3a1016a89acd339 | [
"MIT"
] | null | null | null | collect_world.py | Slauva/robot_shop | 7d0556cf4c614b3f991f334ed3a1016a89acd339 | [
"MIT"
] | 1 | 2021-06-01T16:26:39.000Z | 2021-06-01T16:26:39.000Z | # import xml.etree.ElementTree as ET
import lxml.etree as ET
class World:
def __init__(self, world_path):
# self.world_path = world_path
self.tree = ET.parse(world_path)
self.root = self.tree.getroot() # sdf tag
self.world = self.root[0]
def include_model(self, model, name=No... | 31.285714 | 68 | 0.58105 |
05d007b91496e93abee9ff163a586bf567313fc0 | 2,320 | py | Python | exp_clustering/plot_exp_clustering.py | RandallBalestriero/PMASO | 780b06f8d8496000f3ecda04a49c8eda72393b5d | [
"MIT"
] | null | null | null | exp_clustering/plot_exp_clustering.py | RandallBalestriero/PMASO | 780b06f8d8496000f3ecda04a49c8eda72393b5d | [
"MIT"
] | null | null | null | exp_clustering/plot_exp_clustering.py | RandallBalestriero/PMASO | 780b06f8d8496000f3ecda04a49c8eda72393b5d | [
"MIT"
] | null | null | null | import cPickle
from pylab import *
import glob
import matplotlib as mpl
import cPickle
import os
SAVE_DIR = os.environ['SAVE_DIR']
label_size = 13
mpl.rcParams['xtick.labelsize'] = label_size+10
mpl.rcParams['ytick.labelsize'] = label_size
fs=15
def plotclasses(classes,samplesclass1):
for i,k in zip(range(... | 27.619048 | 123 | 0.576724 |
b64e1656e73144b5cb80dc17f932f67de76e25f2 | 1,246 | py | Python | asiapay/tests/models_tests.py | bitlabstudio/django-oscar-asiapay | 950f62b4d7d5edb79a65a8fd5affa9cb1e9772d9 | [
"MIT"
] | 1 | 2019-03-11T13:52:31.000Z | 2019-03-11T13:52:31.000Z | asiapay/tests/models_tests.py | bitmazk/django-oscar-asiapay | 950f62b4d7d5edb79a65a8fd5affa9cb1e9772d9 | [
"MIT"
] | 3 | 2020-02-12T00:06:51.000Z | 2021-06-10T19:45:35.000Z | asiapay/tests/models_tests.py | bitmazk/django-oscar-asiapay | 950f62b4d7d5edb79a65a8fd5affa9cb1e9772d9 | [
"MIT"
] | null | null | null | """Tests for the models of the ``user_profiles`` app."""
from django.test import TestCase
from . import factories
class AsiaPayTransactionTestCase(TestCase):
"""Tests for the ``AsiaPayTransaction`` model class."""
longMessage = True
def setUp(self):
self.txn = factories.AsiaPayTransactionFactory... | 36.647059 | 79 | 0.65008 |
c4a08a8cd7b25d34164f4d0bcfaa1f094d6b4a59 | 647 | py | Python | HLTrigger/Configuration/python/HLT_75e33/modules/hgcalDigisL1Seeded_cfi.py | PKUfudawei/cmssw | 8fbb5ce74398269c8a32956d7c7943766770c093 | [
"Apache-2.0"
] | 1 | 2021-11-30T16:24:46.000Z | 2021-11-30T16:24:46.000Z | HLTrigger/Configuration/python/HLT_75e33/modules/hgcalDigisL1Seeded_cfi.py | PKUfudawei/cmssw | 8fbb5ce74398269c8a32956d7c7943766770c093 | [
"Apache-2.0"
] | 4 | 2021-11-29T13:57:56.000Z | 2022-03-29T06:28:36.000Z | HLTrigger/Configuration/python/HLT_75e33/modules/hgcalDigisL1Seeded_cfi.py | PKUfudawei/cmssw | 8fbb5ce74398269c8a32956d7c7943766770c093 | [
"Apache-2.0"
] | 1 | 2021-11-30T16:16:05.000Z | 2021-11-30T16:16:05.000Z | import FWCore.ParameterSet.Config as cms
hgcalDigisL1Seeded = cms.EDProducer("HLTHGCalDigisInRegionsProducer",
etaPhiRegions = cms.VPSet(cms.PSet(
inputColl = cms.InputTag("hltL1TEGammaHGCFilteredCollectionProducer"),
maxDEta = cms.double(0.0),
maxDPhi = cms.double(0.0),
maxDeltaR =... | 32.35 | 94 | 0.638331 |
e68e539b16cc764dbed6b2d3711812bf74b360db | 711 | py | Python | task_2/tabs.py | yves147/bwinf40 | b6ecb23cd66482b137e59cb1f28714f81746e1a2 | [
"MIT"
] | 2 | 2021-11-25T17:08:49.000Z | 2021-11-25T21:15:33.000Z | task_2/tabs.py | yves147/bwinf40 | b6ecb23cd66482b137e59cb1f28714f81746e1a2 | [
"MIT"
] | null | null | null | task_2/tabs.py | yves147/bwinf40 | b6ecb23cd66482b137e59cb1f28714f81746e1a2 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import sys
from typing import List
SPACES_PER_TAB = 8
def main():
with open(sys.argv[1], "r", encoding="utf-8") as file:
in_lines = [line.rstrip() for line in file.readlines()]
out_lines: List[str] = []
for line in in_lines:
pos = 0
out_lines.append("")
... | 23.7 | 63 | 0.514768 |
3fe1ddd20faf0fd0d2a7bfd97da5c5a3fbee8f16 | 772 | py | Python | C9/9.4/restaurant.py | Triple-Z/Python-Crash-Course | 7e59104420f6110e4d60668314264105534016ce | [
"MIT"
] | null | null | null | C9/9.4/restaurant.py | Triple-Z/Python-Crash-Course | 7e59104420f6110e4d60668314264105534016ce | [
"MIT"
] | null | null | null | C9/9.4/restaurant.py | Triple-Z/Python-Crash-Course | 7e59104420f6110e4d60668314264105534016ce | [
"MIT"
] | null | null | null | class Restaurant:
def __init__(self, name, cuisine_type):
self.restaurant_name = name
self.cuisine_type = cuisine_type
self.number_served = 0
def describe_restaurant(self):
print('\nRestaurant name: ' + self.restaurant_name.title())
print('Cuisine type: ' + self.cuisine... | 32.166667 | 67 | 0.654145 |
a6fbd43807df4c1320012f5e7f1c975a5b1d3d54 | 21 | py | Python | ImageProcess/__init__.py | DongCX-LDHSP/WindowsFocusWallpaperGetter | d35896f1ddf717c29569a385ba7bd0ffcac857e3 | [
"MIT"
] | 1 | 2020-09-07T08:30:39.000Z | 2020-09-07T08:30:39.000Z | ImageProcess/__init__.py | DongCX-LDHSP/WindowsFocusWallpaperGetter | d35896f1ddf717c29569a385ba7bd0ffcac857e3 | [
"MIT"
] | null | null | null | ImageProcess/__init__.py | DongCX-LDHSP/WindowsFocusWallpaperGetter | d35896f1ddf717c29569a385ba7bd0ffcac857e3 | [
"MIT"
] | null | null | null | """
ImageProcess包
""" | 7 | 13 | 0.619048 |
08d68b8203888e0322739bc9cd3781975bb39f03 | 2,884 | py | Python | rpython/jit/backend/ppc/rassemblermaker.py | jptomo/pypy-lang-scheme | 55edb2cec69d78f86793282a4566fcbc1ef9fcac | [
"MIT"
] | 1 | 2019-11-25T10:52:01.000Z | 2019-11-25T10:52:01.000Z | rpython/jit/backend/ppc/rassemblermaker.py | jptomo/pypy-lang-scheme | 55edb2cec69d78f86793282a4566fcbc1ef9fcac | [
"MIT"
] | null | null | null | rpython/jit/backend/ppc/rassemblermaker.py | jptomo/pypy-lang-scheme | 55edb2cec69d78f86793282a4566fcbc1ef9fcac | [
"MIT"
] | null | null | null | from rpython.tool.sourcetools import compile2
from rpython.rlib.rarithmetic import r_uint
from rpython.jit.backend.ppc.form import IDesc, IDupDesc
from rpython.jit.backend.ppc.ppc_field import IField
## "opcode": ( 0, 5),
## "rA": (11, 15, 'unsigned', regname._R),
## "rB": (16, 20, 'unsigned', reg... | 37.454545 | 87 | 0.496879 |
1a3e7f3d76ebaf80295d10133b5cb78e8979ef3b | 1,511 | py | Python | tests/snippets/stdlib_struct.py | hatchling13/RustPython | b8c94501b8d0d6aeb5a589f6884d6a4a15c2c074 | [
"CC-BY-4.0",
"MIT"
] | 1 | 2019-08-16T06:53:06.000Z | 2019-08-16T06:53:06.000Z | tests/snippets/stdlib_struct.py | hatchling13/RustPython | b8c94501b8d0d6aeb5a589f6884d6a4a15c2c074 | [
"CC-BY-4.0",
"MIT"
] | 6 | 2021-10-14T15:55:16.000Z | 2022-03-31T14:04:02.000Z | tests/snippets/stdlib_struct.py | hatchling13/RustPython | b8c94501b8d0d6aeb5a589f6884d6a4a15c2c074 | [
"CC-BY-4.0",
"MIT"
] | 1 | 2021-01-17T17:49:04.000Z | 2021-01-17T17:49:04.000Z |
from testutils import assert_raises
import struct
data = struct.pack('IH', 14, 12)
assert data == bytes([14, 0, 0, 0, 12, 0])
v1, v2 = struct.unpack('IH', data)
assert v1 == 14
assert v2 == 12
data = struct.pack('<IH', 14, 12)
assert data == bytes([14, 0, 0, 0, 12, 0])
v1, v2 = struct.unpack('<IH', data)
assert v1... | 20.69863 | 66 | 0.622105 |
9857e03cac93f65eb8623f498e653cf244309b42 | 5,435 | py | Python | server/src/database.py | Perruci/UnBox | bf77d384c489fb8d421271fa9db962511d40597d | [
"MIT"
] | null | null | null | server/src/database.py | Perruci/UnBox | bf77d384c489fb8d421271fa9db962511d40597d | [
"MIT"
] | null | null | null | server/src/database.py | Perruci/UnBox | bf77d384c489fb8d421271fa9db962511d40597d | [
"MIT"
] | null | null | null | """ Database module for UnBox application """
import os
import ruamel.yaml as yaml
import pathlib
USER_DATA_FILE = 'server/user_data.yaml'
SERVER_DATABASE_FOLDER = 'server/database/'
# Files ---------------------------------------------------
def create_dir(directory_path):
""" Creates a directory if it doesnt e... | 32.159763 | 92 | 0.661638 |
9b43322c18e46264cb5d892ca20ec0e459019394 | 425 | py | Python | files/generator/generator_example.py | aikrasnov/otus-examples | 607fe0c11d812bdff57d92fc0949d5bdf3356c22 | [
"MIT"
] | 8 | 2019-11-03T18:59:08.000Z | 2020-10-10T18:50:09.000Z | files/generator/generator_example.py | aikrasnov/otus-examples | 607fe0c11d812bdff57d92fc0949d5bdf3356c22 | [
"MIT"
] | null | null | null | files/generator/generator_example.py | aikrasnov/otus-examples | 607fe0c11d812bdff57d92fc0949d5bdf3356c22 | [
"MIT"
] | null | null | null | def squares(start, stop):
for i in range(start, stop):
value = yield i * i
print("passed to generator", value)
foo = squares(1, 5)
print("\n")
print("squares() type is", type(squares))
print("foo type is", type(foo))
# print(next(foo))
# print(next(foo))
# print(next(foo))
#
# foo.send("bar")
#... | 15.178571 | 43 | 0.602353 |
800158e0283c9031d51feeb3002da20f3a5f6cac | 12,503 | py | Python | networks/SimpleNetworkSpine.py | sbelharbi/Permutohedral_attention_module | b0d13347e2aa314e14ac21f56ec16e61947000ae | [
"Apache-2.0"
] | 25 | 2019-07-03T01:17:25.000Z | 2022-02-07T19:01:15.000Z | networks/SimpleNetworkSpine.py | sbelharbi/Permutohedral_attention_module | b0d13347e2aa314e14ac21f56ec16e61947000ae | [
"Apache-2.0"
] | 6 | 2019-07-17T09:14:57.000Z | 2021-09-08T15:05:10.000Z | networks/SimpleNetworkSpine.py | sbelharbi/Permutohedral_attention_module | b0d13347e2aa314e14ac21f56ec16e61947000ae | [
"Apache-2.0"
] | 12 | 2019-07-23T05:24:55.000Z | 2022-01-19T14:38:49.000Z | import numpy as np
import torch.nn as nn
import torch.nn.functional as F
import torch
from PAM import PAM
class SimpleNet(nn.Module):
def __init__(self, non_local=False, dilated=False):
super(SimpleNet, self).__init__()
self.non_local = non_local
self.dilated = dilated
n_f = 1... | 47.181132 | 92 | 0.29313 |
7bad726695e707c5f11b33063afabd324dc1fd96 | 88,771 | py | Python | Scripts/Main_simulations_functions_1.py | PJGilmw/MicroRep | 08e72e3eb153d324751172675b7beeb118975cbf | [
"BSD-3-Clause"
] | null | null | null | Scripts/Main_simulations_functions_1.py | PJGilmw/MicroRep | 08e72e3eb153d324751172675b7beeb118975cbf | [
"BSD-3-Clause"
] | null | null | null | Scripts/Main_simulations_functions_1.py | PJGilmw/MicroRep | 08e72e3eb153d324751172675b7beeb118975cbf | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Wed Jun 2 10:45:34 2021
@author: Pierre Jouannais, Department of Planning, DCEA, Aalborg University
pijo@plan.aau.dk
"""
'''
Script containing the main functions calling the other scripts to calculate the LCAs,
performs uncertainty propagation and sensitivy analysis.
'''
imp... | 38.680174 | 192 | 0.595758 |
170ccce2431894ea5943b1b784e6683e3dfa278d | 4,159 | py | Python | tests/python/gaia-ui-tests/gaiatest/apps/settings/regions/device_info.py | ahal/gaia | f90af6ed55795d13d16e1a4d7745643a124b4001 | [
"Apache-2.0"
] | null | null | null | tests/python/gaia-ui-tests/gaiatest/apps/settings/regions/device_info.py | ahal/gaia | f90af6ed55795d13d16e1a4d7745643a124b4001 | [
"Apache-2.0"
] | null | null | null | tests/python/gaia-ui-tests/gaiatest/apps/settings/regions/device_info.py | ahal/gaia | f90af6ed55795d13d16e1a4d7745643a124b4001 | [
"Apache-2.0"
] | null | null | null | # 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 http://mozilla.org/MPL/2.0/.
from marionette.by import By
from gaiatest.apps.base import Base
class DeviceInfo(Base):
_phone_number_locator = ... | 40.77451 | 119 | 0.693195 |
303d22ee80fad4cdd23a5dd47e16997debe71a1c | 1,069 | py | Python | ifmap/metadata.py | kiran-vemuri/ifmap-python-client | 06198cface6421c50c7352009b8370713a414db5 | [
"BSD-2-Clause-FreeBSD"
] | 2 | 2015-01-21T11:52:27.000Z | 2017-01-24T05:13:55.000Z | ifmap/metadata.py | ITI/ifmap-python-client | 15c9e12454a0e277a6668e9c469eb401e3fae100 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | ifmap/metadata.py | ITI/ifmap-python-client | 15c9e12454a0e277a6668e9c469eb401e3fae100 | [
"BSD-2-Clause-FreeBSD"
] | 3 | 2015-03-11T07:51:30.000Z | 2016-10-12T06:08:08.000Z | # Copyright 2011, Infoblox, All Rights Reserved
#
# Open Source, see LICENSE
#
from util import attr, link_ids
class MetadataBase:
""" foundation class for metadata factory """
pass
class Metadata(MetadataBase):
"""
Metadata factory
"""
__ns_uri = ''
def __init__(self, name, value=Non... | 29.694444 | 144 | 0.552853 |
1aedc1c38660cef8db4292d5612165f04c29f662 | 6,031 | py | Python | lightreid/data/datasets/reid_samples.py | nataliamiccini/light-reid | 1bd823849e4a40c9a17497bb7d7ec6097635f4d6 | [
"MIT"
] | 296 | 2020-07-20T02:11:34.000Z | 2022-03-27T12:42:11.000Z | lightreid/data/datasets/reid_samples.py | nataliamiccini/light-reid | 1bd823849e4a40c9a17497bb7d7ec6097635f4d6 | [
"MIT"
] | 33 | 2020-08-27T03:20:43.000Z | 2022-03-14T11:25:07.000Z | lightreid/data/datasets/reid_samples.py | nataliamiccini/light-reid | 1bd823849e4a40c9a17497bb7d7ec6097635f4d6 | [
"MIT"
] | 61 | 2020-07-20T06:19:22.000Z | 2022-03-28T07:10:39.000Z | """
@author: wangguanan
@contact: guan.wang0706@gmail.com
"""
import os
import os.path as osp
from prettytable import PrettyTable
import tarfile
import zipfile
import time
import sys
import errno
import copy
class ReIDSamples:
'''
An abstract class representing a Re-ID samples.
Attrs:
train ... | 35.063953 | 127 | 0.566573 |
c1517c3be953e131f9283f73720240c94637e722 | 1,318 | py | Python | btre-project/listings/migrations/0002_auto_20210227_1314.py | amirzp/btre-project | 270fa639d71df5d3d11c356715e6b134da23b9cd | [
"MIT"
] | 1 | 2021-03-02T11:43:30.000Z | 2021-03-02T11:43:30.000Z | btre-project/listings/migrations/0002_auto_20210227_1314.py | amirzp/btre-project | 270fa639d71df5d3d11c356715e6b134da23b9cd | [
"MIT"
] | null | null | null | btre-project/listings/migrations/0002_auto_20210227_1314.py | amirzp/btre-project | 270fa639d71df5d3d11c356715e6b134da23b9cd | [
"MIT"
] | null | null | null | # Generated by Django 3.1.7 on 2021-02-27 13:14
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('listings', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='listings',
name='photo_1',
... | 29.954545 | 78 | 0.545524 |
d0bf0f7ee341518c4ef31d2c375167e087e7475a | 4,589 | py | Python | image.py | jbilskie/BME547_final | fe29a452259f3ac311ba083f45076ce79de2bec6 | [
"MIT"
] | null | null | null | image.py | jbilskie/BME547_final | fe29a452259f3ac311ba083f45076ce79de2bec6 | [
"MIT"
] | 49 | 2019-04-10T18:16:29.000Z | 2019-04-29T05:51:05.000Z | image.py | jbilskie/BME547_final | fe29a452259f3ac311ba083f45076ce79de2bec6 | [
"MIT"
] | null | null | null | # image.py
# Authors: Jessica Bilskie, Janet Chen, Kevin Chu
# Last Modified: 4/25/19
import base64
import io
from matplotlib import pyplot as plt
import matplotlib.image as mpimg
import numpy as np
import zipfile
import re
from PIL import Image
def read_img_as_b64(file_path):
""" Reads in image as b64
This... | 27.315476 | 70 | 0.629113 |
44fa491bef64cfb395232ed9298b20fe6f2d8ac3 | 14,346 | py | Python | pyteomics/auxiliary/structures.py | donnyyy777/pyteomics | dc0cafb16823767457fa52342574e3fa1c61b970 | [
"Apache-2.0"
] | null | null | null | pyteomics/auxiliary/structures.py | donnyyy777/pyteomics | dc0cafb16823767457fa52342574e3fa1c61b970 | [
"Apache-2.0"
] | null | null | null | pyteomics/auxiliary/structures.py | donnyyy777/pyteomics | dc0cafb16823767457fa52342574e3fa1c61b970 | [
"Apache-2.0"
] | null | null | null | import re
from collections import defaultdict, Counter
import warnings
try:
basestring
PY2 = True
except NameError:
basestring = (str, bytes)
PY2 = False
_UNIT_CV_INTERN_TABLE = dict()
def clear_unit_cv_table():
"""Clear the module-level unit name and
controlled vocabulary accession table.
... | 30.458599 | 109 | 0.57577 |
43fe230db121b88e3496b60676b24624f3d34b4b | 13,902 | py | Python | data/github/preprocessing/src/dataset.py | devjeetr/PLBART | 7c80850000bfca2058aaf2dbce9c9f8bb80981ec | [
"MIT"
] | 99 | 2021-03-12T17:12:02.000Z | 2022-03-29T03:04:14.000Z | data/github/preprocessing/src/dataset.py | devjeetr/PLBART | 7c80850000bfca2058aaf2dbce9c9f8bb80981ec | [
"MIT"
] | 32 | 2021-03-24T15:43:02.000Z | 2022-03-30T21:21:45.000Z | data/github/preprocessing/src/dataset.py | devjeetr/PLBART | 7c80850000bfca2058aaf2dbce9c9f8bb80981ec | [
"MIT"
] | 18 | 2021-03-26T23:43:28.000Z | 2022-03-24T05:55:05.000Z | # Copyright (c) 2019-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
#
import itertools
import subprocess
from pathlib import Path
from data.github.preprocessing.src.utils import (
shuf_file,
... | 42.907407 | 138 | 0.590203 |
8a0641f89560df74b99d846e25f15c0a0a01d283 | 716 | py | Python | setup.py | asprazz/stockStalker | 4812d17e544721939657ef4b2e5e0f60bbd236a9 | [
"MIT"
] | 2 | 2020-06-13T07:24:51.000Z | 2021-02-05T21:43:26.000Z | setup.py | asprazz/stockStalker | 4812d17e544721939657ef4b2e5e0f60bbd236a9 | [
"MIT"
] | null | null | null | setup.py | asprazz/stockStalker | 4812d17e544721939657ef4b2e5e0f60bbd236a9 | [
"MIT"
] | 1 | 2020-06-13T07:25:01.000Z | 2020-06-13T07:25:01.000Z | from setuptools import setup, find_packages
setup(
name="stockStalker",
author="Ankush Patil",
version="0.0.1",
url="https://github.com/asprazz/stockStalker",
description="Python CLI Application for Tracking portfolio.",
packages=[
"stockStalker"
],
install_requires=[
'r... | 24.689655 | 67 | 0.582402 |
1f44fef3eebc9e7336c981b6739cf015b29dd544 | 4,763 | py | Python | kobe/data/download.py | stungkit/KOBE | 274e46d41cac5f526e764dc6001cf545dbbcd6bb | [
"MIT"
] | 9 | 2019-05-01T08:46:06.000Z | 2019-05-13T14:00:28.000Z | kobe/data/download.py | stungkit/KOBE | 274e46d41cac5f526e764dc6001cf545dbbcd6bb | [
"MIT"
] | 2 | 2019-05-03T13:35:42.000Z | 2019-05-13T11:55:17.000Z | kobe/data/download.py | stungkit/KOBE | 274e46d41cac5f526e764dc6001cf545dbbcd6bb | [
"MIT"
] | 4 | 2019-05-02T09:28:31.000Z | 2022-01-13T06:42:41.000Z | import hashlib
import os
import shutil
import time
from urllib.request import urlopen
import gdown
import requests
import tqdm
def download(url, path, fname, redownload=False):
"""
Downloads file using `requests`. If ``redownload`` is set to false, then
will not download tar file again if it is present (... | 33.542254 | 86 | 0.536427 |
a9a43b6f024670d674483485f271b000ad38f332 | 3,233 | py | Python | tempest/api/orchestration/stacks/test_update.py | rcbops-qe/tempest | 88960aa32c473b64072671541a136dbae41b1d4c | [
"Apache-2.0"
] | 3 | 2015-03-03T15:43:06.000Z | 2016-10-24T06:12:40.000Z | tempest/api/orchestration/stacks/test_update.py | rcbops-qe/tempest | 88960aa32c473b64072671541a136dbae41b1d4c | [
"Apache-2.0"
] | null | null | null | tempest/api/orchestration/stacks/test_update.py | rcbops-qe/tempest | 88960aa32c473b64072671541a136dbae41b1d4c | [
"Apache-2.0"
] | null | null | null | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | 38.035294 | 78 | 0.686978 |
6eec9090c04b2dcb895b8e36c23aa5cd30cf6283 | 1,399 | py | Python | decorators/log.py | tarasivashchuk/Cookbooks | efb8ac7340f5d110d95da084615504fdd8081111 | [
"MIT"
] | 1 | 2020-07-03T06:42:58.000Z | 2020-07-03T06:42:58.000Z | decorators/log.py | tarasivashchuk/cookbooks | efb8ac7340f5d110d95da084615504fdd8081111 | [
"MIT"
] | null | null | null | decorators/log.py | tarasivashchuk/cookbooks | efb8ac7340f5d110d95da084615504fdd8081111 | [
"MIT"
] | null | null | null | import logging
from functools import wraps
from sys import stdout
logging.basicConfig(stream=stdout, level=logging.DEBUG)
def log_output(func):
def wrapper():
logger = logging.getLogger(func.__name__)
output = func()
logger.info(f"Output: {output}")
return wrapper
def log_args(fun... | 20.880597 | 60 | 0.625447 |
cb18e6c9e36377d1451ae3bebc95119ded7fde6a | 6,153 | py | Python | movies_analyzer/Imdb.py | mateuszrusin/filmweb-rekomendacje | 06bdff3825f4c9e7b80fb5778d1a40388d2313d9 | [
"MIT"
] | 3 | 2019-12-10T10:20:07.000Z | 2020-12-03T17:37:24.000Z | movies_analyzer/Imdb.py | mateuszrusin/filmweb-rekomendacje | 06bdff3825f4c9e7b80fb5778d1a40388d2313d9 | [
"MIT"
] | 2 | 2021-03-31T19:31:04.000Z | 2021-12-13T20:32:18.000Z | movies_analyzer/Imdb.py | mateuszrusin/filmweb-rekomendacje | 06bdff3825f4c9e7b80fb5778d1a40388d2313d9 | [
"MIT"
] | 4 | 2019-11-21T23:49:39.000Z | 2020-12-03T17:37:26.000Z | #!/usr/bin/env python
# coding: utf-8
import pandas as pd
from filmweb_integrator.fwimdbmerge.utils import to_list
from pathlib import Path
import pyarrow.parquet as pq
import pyarrow as pa
from imdb import IMDb as ImdbServer
import urllib.request
import pickle
import os.path
ROOT = str(Path(__file__).parent.parent.... | 37.748466 | 122 | 0.635137 |
7a3e59ab9c0e3387f8883c5a1b90064f7b84ceca | 7,893 | py | Python | ddt_request_history/panels/request_history.py | djsutho/django-debug-toolbar-request-history | df23cf96f7106453bce087397834aa6e1927621e | [
"BSD-3-Clause"
] | 129 | 2015-01-30T19:04:14.000Z | 2022-01-03T00:50:05.000Z | ddt_request_history/panels/request_history.py | djsutho/django-debug-toolbar-request-history | df23cf96f7106453bce087397834aa6e1927621e | [
"BSD-3-Clause"
] | 30 | 2015-04-24T12:40:24.000Z | 2020-10-06T11:20:01.000Z | ddt_request_history/panels/request_history.py | djsutho/django-debug-toolbar-request-history | df23cf96f7106453bce087397834aa6e1927621e | [
"BSD-3-Clause"
] | 26 | 2015-03-13T09:33:58.000Z | 2022-02-26T12:52:27.000Z | from __future__ import absolute_import, unicode_literals
import json
import logging
import os
import re
import sys
import threading
import uuid
import debug_toolbar
from collections import OrderedDict
from datetime import datetime
from distutils.version import LooseVersion
from django.conf import settings
from djan... | 33.587234 | 107 | 0.652857 |
cdc39b4ff2f8ddeafe3d8d19349bf0a145af9acb | 3,412 | py | Python | utils.py | ksquarekumar/facial-keypoints | b422a1954665c27fd254312c7499bb2773f4ecf1 | [
"MIT"
] | 1 | 2019-03-29T16:52:03.000Z | 2019-03-29T16:52:03.000Z | utils.py | planetnoob/facial-keypoints | b422a1954665c27fd254312c7499bb2773f4ecf1 | [
"MIT"
] | null | null | null | utils.py | planetnoob/facial-keypoints | b422a1954665c27fd254312c7499bb2773f4ecf1 | [
"MIT"
] | null | null | null | import os
import cv2
import numpy as np
import matplotlib.pyplot as plt
from keras.models import load_model
from pandas.io.parsers import read_csv
from sklearn.utils import shuffle
def load_data(test=False):
"""
Loads data from FTEST if *test* is True, otherwise from FTRAIN.
Important that the files are i... | 36.688172 | 88 | 0.607855 |
29637c631e3fa04c7764e344111597dccdd39099 | 1,806 | py | Python | 001a_minimal_frame_temporal_separation.py | ofgulban/minimalist_psychopy_examples | 71864ca7f829f4846d1aa002754117565b6549ba | [
"Unlicense"
] | 1 | 2019-01-29T17:04:08.000Z | 2019-01-29T17:04:08.000Z | 001a_minimal_frame_temporal_separation.py | ofgulban/minimalist_psychopy_examples | 71864ca7f829f4846d1aa002754117565b6549ba | [
"Unlicense"
] | null | null | null | 001a_minimal_frame_temporal_separation.py | ofgulban/minimalist_psychopy_examples | 71864ca7f829f4846d1aa002754117565b6549ba | [
"Unlicense"
] | null | null | null | """Minimal frame for two stimuli separated in time."""
from psychopy import core, event, monitors, visual
# =============================================================================
# MONITOR
# Set monitor information used in the experimental setup
moni = monitors.Monitor('testMonitor', width=8.2, distan... | 25.8 | 80 | 0.477852 |
01cb9556c92f1cd681faa3e26de49131e4d87606 | 146 | py | Python | output/models/sun_data/schema/annotations/annotations00101m/annotations00101m4_xsd/__init__.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | 1 | 2021-08-14T17:59:21.000Z | 2021-08-14T17:59:21.000Z | output/models/sun_data/schema/annotations/annotations00101m/annotations00101m4_xsd/__init__.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | 4 | 2020-02-12T21:30:44.000Z | 2020-04-15T20:06:46.000Z | output/models/sun_data/schema/annotations/annotations00101m/annotations00101m4_xsd/__init__.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | null | null | null | from output.models.sun_data.schema.annotations.annotations00101m.annotations00101m4_xsd.annotations00101m4 import Root
__all__ = [
"Root",
]
| 24.333333 | 118 | 0.815068 |
3a5946abebc00b2b69cdbc61222a4b2f4338f651 | 225 | py | Python | examples/plugin/setup.py | lasta/preacher | 5e50f8eb930fac72a788e7614eb5a85903f7bde6 | [
"MIT"
] | null | null | null | examples/plugin/setup.py | lasta/preacher | 5e50f8eb930fac72a788e7614eb5a85903f7bde6 | [
"MIT"
] | null | null | null | examples/plugin/setup.py | lasta/preacher | 5e50f8eb930fac72a788e7614eb5a85903f7bde6 | [
"MIT"
] | null | null | null | from setuptools import setup
setup(
name='preacher-plugin-example',
version='0.0.0',
py_modules=['custom_matcher'],
entry_points={'preacher': 'matcher = custom_matcher'},
install_requires=['preacher'],
)
| 22.5 | 58 | 0.684444 |
5298d8de30d884783f1af9fd734f6b5da70c10fd | 3,256 | py | Python | demo/demo.py | dt3310321/cos-python-sdk-v5 | dc337d33898012621ac9bb5c0574ee2278af9e27 | [
"MIT"
] | null | null | null | demo/demo.py | dt3310321/cos-python-sdk-v5 | dc337d33898012621ac9bb5c0574ee2278af9e27 | [
"MIT"
] | null | null | null | demo/demo.py | dt3310321/cos-python-sdk-v5 | dc337d33898012621ac9bb5c0574ee2278af9e27 | [
"MIT"
] | null | null | null | # -*- coding=utf-8
from qcloud_cos import CosConfig
from qcloud_cos import CosS3Client
from qcloud_cos import CosServiceError
from qcloud_cos import CosClientError
import sys
import logging
# 腾讯云COSV5Python SDK, 目前可以支持Python2.6与Python2.7以及Python3.x
# pip安装指南:pip install -U cos-python-sdk-v5
# cos最新可用地域,参照https://ww... | 23.766423 | 98 | 0.696253 |
fcab5286621c19626cb87d56fe316ab567ae04f6 | 13,312 | py | Python | sparse/coo/indexing.py | nimroha/sparse | 975a202fb68452dc3cc4421c18f415bc7d5033e8 | [
"BSD-3-Clause"
] | 2 | 2018-06-12T18:48:48.000Z | 2018-07-01T18:09:33.000Z | sparse/coo/indexing.py | nimroha/sparse | 975a202fb68452dc3cc4421c18f415bc7d5033e8 | [
"BSD-3-Clause"
] | null | null | null | sparse/coo/indexing.py | nimroha/sparse | 975a202fb68452dc3cc4421c18f415bc7d5033e8 | [
"BSD-3-Clause"
] | 2 | 2018-06-11T20:52:16.000Z | 2018-06-12T18:48:59.000Z | from collections import Iterable
from numbers import Integral
import numba
import numpy as np
from ..compatibility import range, zip_longest
from ..slicing import normalize_index
from ..utils import _zero_of_dtype
def getitem(x, index):
"""
This function implements the indexing functionality for COO.
T... | 29.51663 | 100 | 0.583459 |
0aba7fec95a40317fb1568ee7b30d677fe49d2b7 | 12,061 | py | Python | fairness_teaching/in_progress/rl_a2c/train.py | deepneuralmachine/google-research | d2ce2cf0f5c004f8d78bfeddf6e88e88f4840231 | [
"Apache-2.0"
] | 23,901 | 2018-10-04T19:48:53.000Z | 2022-03-31T21:27:42.000Z | fairness_teaching/in_progress/rl_a2c/train.py | deepneuralmachine/google-research | d2ce2cf0f5c004f8d78bfeddf6e88e88f4840231 | [
"Apache-2.0"
] | 891 | 2018-11-10T06:16:13.000Z | 2022-03-31T10:42:34.000Z | fairness_teaching/in_progress/rl_a2c/train.py | deepneuralmachine/google-research | d2ce2cf0f5c004f8d78bfeddf6e88e88f4840231 | [
"Apache-2.0"
] | 6,047 | 2018-10-12T06:31:02.000Z | 2022-03-31T13:59:28.000Z | # coding=utf-8
# Copyright 2021 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | 40.337793 | 147 | 0.679546 |
216cf4dadaacac7ace779cfdaa6ed01560cf44c8 | 2,769 | py | Python | test/integration/rmq_2_sysmon/run_program.py | mjpernot/rmq-sysmon | 728f696a451b6c870feb22e53be09bfcd7ed3c77 | [
"MIT"
] | null | null | null | test/integration/rmq_2_sysmon/run_program.py | mjpernot/rmq-sysmon | 728f696a451b6c870feb22e53be09bfcd7ed3c77 | [
"MIT"
] | null | null | null | test/integration/rmq_2_sysmon/run_program.py | mjpernot/rmq-sysmon | 728f696a451b6c870feb22e53be09bfcd7ed3c77 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# Classification (U)
"""Program: run_program.py
Description: Integration testing of run_program in rmq_2_sysmon.py.
Usage:
test/integration/rmq_2_sysmon/run_program.py
Arguments:
"""
# Libraries and Global Variables
# Standard
import sys
import os
if sys.version_info < (2... | 24.504425 | 76 | 0.649693 |
712974cb3d989fe2a43b804a0724c95593cb0022 | 671 | py | Python | tests/test_hash.py | Jeremiah-England/Shapely | 769b203f2b7cbeeb0a694c21440b4025a563f807 | [
"BSD-3-Clause"
] | 2,382 | 2015-01-04T03:16:59.000Z | 2021-12-10T15:48:56.000Z | tests/test_hash.py | Jeremiah-England/Shapely | 769b203f2b7cbeeb0a694c21440b4025a563f807 | [
"BSD-3-Clause"
] | 1,009 | 2015-01-03T23:44:02.000Z | 2021-12-10T16:02:42.000Z | tests/test_hash.py | Jeremiah-England/Shapely | 769b203f2b7cbeeb0a694c21440b4025a563f807 | [
"BSD-3-Clause"
] | 467 | 2015-01-19T23:18:33.000Z | 2021-12-09T18:31:28.000Z | from shapely.geometry import Point, MultiPoint, Polygon, GeometryCollection
def test_point():
g = Point(0, 0)
try:
assert hash(g)
return False
except TypeError:
return True
def test_multipoint():
g = MultiPoint([(0, 0)])
try:
assert hash(g)
return False
... | 17.657895 | 75 | 0.584203 |
27e26c0b26c7f50eca8a8e8c144a7dbfd9fb0afb | 9,482 | py | Python | tests/test_modeling_tf_electra.py | malteos/transformers | cafa6a9e29f3e99c67a1028f8ca779d439bc0689 | [
"Apache-2.0"
] | 23 | 2020-10-26T11:10:30.000Z | 2022-03-21T10:18:08.000Z | tests/test_modeling_tf_electra.py | malteos/transformers | cafa6a9e29f3e99c67a1028f8ca779d439bc0689 | [
"Apache-2.0"
] | 2 | 2020-10-29T07:59:57.000Z | 2021-09-08T14:49:44.000Z | tests/test_modeling_tf_electra.py | malteos/transformers | cafa6a9e29f3e99c67a1028f8ca779d439bc0689 | [
"Apache-2.0"
] | 8 | 2020-12-31T03:30:57.000Z | 2022-03-21T08:12:54.000Z | # coding=utf-8
# Copyright 2018 The Google AI Language Team Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... | 41.587719 | 116 | 0.656507 |
9d30c3d8729e194656a32992221dbee31ce855fa | 1,267 | py | Python | tools/pylightnet/pylightnet/context.py | SiyuanMa0316/LightNet | 931479d28695f3e871ba5eeae60a8ef4d84de72d | [
"MIT"
] | null | null | null | tools/pylightnet/pylightnet/context.py | SiyuanMa0316/LightNet | 931479d28695f3e871ba5eeae60a8ef4d84de72d | [
"MIT"
] | 1 | 2019-03-08T13:18:36.000Z | 2019-03-08T13:18:36.000Z | tools/pylightnet/pylightnet/context.py | SiyuanMa0316/LightNet | 931479d28695f3e871ba5eeae60a8ef4d84de72d | [
"MIT"
] | null | null | null | from ctypes import *
import lib
def create():
lib.libln.ln_context_create.restype = c_void_p
return lib.libln.ln_context_create()
def init(ctx, source):
lib.libln.ln_context_init(ctx, source)
def cleanup(ctx):
lib.libln.ln_context_cleanup(ctx)
def free(ctx):
lib.libln.ln_context_free(ctx)
def c... | 25.34 | 76 | 0.715075 |
991bae49a484ef06027e4de9d26f0335ac4df207 | 9,959 | py | Python | contrib/spendfrom/spendfrom.py | mxdum/Mxdum | 813de58604a5dc0936e61c440af8b768cb35f055 | [
"MIT"
] | null | null | null | contrib/spendfrom/spendfrom.py | mxdum/Mxdum | 813de58604a5dc0936e61c440af8b768cb35f055 | [
"MIT"
] | 1 | 2019-02-23T21:39:25.000Z | 2019-02-23T21:39:25.000Z | contrib/spendfrom/spendfrom.py | mxdum/Mxdum | 813de58604a5dc0936e61c440af8b768cb35f055 | [
"MIT"
] | 1 | 2019-02-23T21:34:31.000Z | 2019-02-23T21:34:31.000Z | #!/usr/bin/env python
#
# Use the raw transactions API to spend MDMs received on particular addresses,
# and send any change back to that same address.
#
# Example usage:
# spendfrom.py # Lists available funds
# spendfrom.py --from=ADDRESS --to=ADDRESS --amount=11.00
#
# Assumes it will talk to a mxdumd or mxdum-Qt ... | 37.160448 | 111 | 0.629782 |
c4a9e0870c2568093f0a2209f5ffc0b78ef03ef6 | 5,080 | py | Python | wb/main/utils/dev_cloud_http_service.py | apaniukov/workbench | 2f2653ecfd0143d2d53e33ad84379f13443fdfaa | [
"Apache-2.0"
] | 23 | 2022-03-17T12:24:09.000Z | 2022-03-31T09:13:30.000Z | wb/main/utils/dev_cloud_http_service.py | apaniukov/workbench | 2f2653ecfd0143d2d53e33ad84379f13443fdfaa | [
"Apache-2.0"
] | 18 | 2022-03-21T08:17:44.000Z | 2022-03-30T12:42:30.000Z | wb/main/utils/dev_cloud_http_service.py | apaniukov/workbench | 2f2653ecfd0143d2d53e33ad84379f13443fdfaa | [
"Apache-2.0"
] | 16 | 2022-03-17T12:24:14.000Z | 2022-03-31T12:15:12.000Z | """
OpenVINO DL Workbench
Class for working with DevCloud Service HTTP API
Copyright (c) 2020 Intel Corporation
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/lic... | 40.64 | 118 | 0.745866 |
96b71b7c8a6df14b5b3bb53c8506f7443088a7bc | 3,936 | py | Python | envoy/tests/test_envoy.py | jstoja/integrations-core | 704fa31f7db642c6df9e0969b3b2778fc6144fa7 | [
"BSD-3-Clause"
] | null | null | null | envoy/tests/test_envoy.py | jstoja/integrations-core | 704fa31f7db642c6df9e0969b3b2778fc6144fa7 | [
"BSD-3-Clause"
] | null | null | null | envoy/tests/test_envoy.py | jstoja/integrations-core | 704fa31f7db642c6df9e0969b3b2778fc6144fa7 | [
"BSD-3-Clause"
] | 1 | 2019-12-23T13:35:17.000Z | 2019-12-23T13:35:17.000Z | # (C) Datadog, Inc. 2018
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
from copy import deepcopy
import mock
import pytest
from datadog_checks.envoy import Envoy
from datadog_checks.envoy.metrics import METRIC_PREFIX, METRICS
from .common import HOST, INSTANCES, response
CHECK_NA... | 32 | 111 | 0.694868 |
43744659fe23074da5bcbc98c10be8bee3cf36b4 | 2,526 | py | Python | tests/test_physt_histogram.py | artemis-analytics/artemis | 3e1eebdd4628145ee7d8923567b5e6f53a2e5244 | [
"Apache-2.0"
] | 4 | 2020-02-29T15:02:05.000Z | 2021-05-13T18:50:58.000Z | tests/test_physt_histogram.py | artemis-analytics/artemis | 3e1eebdd4628145ee7d8923567b5e6f53a2e5244 | [
"Apache-2.0"
] | 25 | 2020-02-25T19:29:21.000Z | 2020-04-03T15:06:59.000Z | tests/test_physt_histogram.py | ryanmwhitephd/artemis | 3e1eebdd4628145ee7d8923567b5e6f53a2e5244 | [
"Apache-2.0"
] | 2 | 2021-08-12T09:40:51.000Z | 2021-08-12T09:42:09.000Z | # Copyright © Her Majesty the Queen in Right of Canada, as represented
# by the Minister of Statistics Canada, 2019.
#
# 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.... | 33.236842 | 85 | 0.651623 |
d6f8119b02f3f14f7bb4809e6183d0fa67ff8096 | 57,753 | py | Python | Python-3.5.10/Lib/test/test_email/test_headerregistry.py | AtriCZE23/POe-full | 89be2fda5747e44764a62ba5e358d8c9309fbf0a | [
"MIT",
"CNRI-Python-GPL-Compatible",
"BSD-3-Clause"
] | 6 | 2018-02-23T08:52:04.000Z | 2021-08-19T12:01:50.000Z | Python-3.5.10/Lib/test/test_email/test_headerregistry.py | AtriCZE23/Atri | 34ed092852b49daeafeb9c94adf3bfba42819b37 | [
"MIT",
"CNRI-Python-GPL-Compatible",
"BSD-3-Clause"
] | 5 | 2021-12-14T20:56:36.000Z | 2021-12-20T14:45:34.000Z | Python-3.5.10/Lib/test/test_email/test_headerregistry.py | AtriCZE23/POe-full | 89be2fda5747e44764a62ba5e358d8c9309fbf0a | [
"MIT",
"CNRI-Python-GPL-Compatible",
"BSD-3-Clause"
] | 1 | 2019-05-06T14:36:47.000Z | 2019-05-06T14:36:47.000Z | import datetime
import textwrap
import unittest
import types
from email import errors
from email import policy
from email.message import Message
from test.test_email import TestEmailBase, parameterize
from email import headerregistry
from email.headerregistry import Address, Group
DITTO = object()
class TestHeaderR... | 35.716141 | 102 | 0.53218 |
dc58f3dabae186dfd83fc40be1fe185f19e7aa2f | 661 | py | Python | setup.py | narbutas/pgbackup | 2bc65dc9c4cdba135e0ae68c71d034de50fddda8 | [
"Apache-2.0"
] | null | null | null | setup.py | narbutas/pgbackup | 2bc65dc9c4cdba135e0ae68c71d034de50fddda8 | [
"Apache-2.0"
] | null | null | null | setup.py | narbutas/pgbackup | 2bc65dc9c4cdba135e0ae68c71d034de50fddda8 | [
"Apache-2.0"
] | null | null | null | from setuptools import find_packages, setup
with open('README.md', 'r') as f:
long_description = f.read()
setup(
name='pgbackup',
version='1.0.0',
author='Tadas Narbutas',
author_email='narbutas.tadas@gmail.com',
descrption='CLI tool for PostgreSQL backup',
summary='CLI tool for PostgreSQL backup',
license='A... | 25.423077 | 47 | 0.727685 |
c53f09e699508f98c067f871551fa75bda29b7e3 | 1,160 | py | Python | examples/hlapi/v3arch/asyncore/sync/agent/ntforg/v2c-trap-with-notification-objects.py | RKinsey/pysnmp | 96b5cf31e2f5d19f34d0dd1075014c488f6a5789 | [
"BSD-2-Clause"
] | 492 | 2016-03-13T11:03:13.000Z | 2022-03-21T02:52:57.000Z | examples/hlapi/v3arch/asyncore/sync/agent/ntforg/v2c-trap-with-notification-objects.py | bartomo/pysnmp | becd15c79c9a6b5696928ecd50bf5cca8b1770a1 | [
"BSD-2-Clause"
] | 372 | 2016-03-29T22:42:05.000Z | 2022-03-26T10:28:25.000Z | examples/hlapi/v3arch/asyncore/sync/agent/ntforg/v2c-trap-with-notification-objects.py | bartomo/pysnmp | becd15c79c9a6b5696928ecd50bf5cca8b1770a1 | [
"BSD-2-Clause"
] | 197 | 2016-03-13T11:01:54.000Z | 2022-03-07T19:52:15.000Z | """
SNMPv2c TRAP via NOTIFICATION-TYPE
++++++++++++++++++++++++++++++++++
Initialize TRAP message contents from variables specified
in *NOTIFICATION-TYPE* SMI macro.
* SNMPv2c
* with community name 'public'
* over IPv4/UDP
* send TRAP notification
* with TRAP ID 'linkUp' specified as a MIB symbol
* include values for... | 26.363636 | 153 | 0.636207 |
52ef6aef55266aa4b938d5c4b2af97e00c2a9e7f | 344 | py | Python | Structured Programming/Lesson 03 - Basic Operators & Input/ex_5.py | Raffaelus/Computer-Science-Graduation---UNIP | 05fd10d05efb63d9b6024f73947846f9ec805c25 | [
"MIT"
] | null | null | null | Structured Programming/Lesson 03 - Basic Operators & Input/ex_5.py | Raffaelus/Computer-Science-Graduation---UNIP | 05fd10d05efb63d9b6024f73947846f9ec805c25 | [
"MIT"
] | null | null | null | Structured Programming/Lesson 03 - Basic Operators & Input/ex_5.py | Raffaelus/Computer-Science-Graduation---UNIP | 05fd10d05efb63d9b6024f73947846f9ec805c25 | [
"MIT"
] | null | null | null | nome = input("Digite o nome do aluno: ")
notas = list(range(3))
notas[0] = float(input("Digite a nota 1: "))
notas[1] = float(input("Digite a nota 2: "))
notas[2] = float(input("Digite a nota 3: "))
soma_notas = 0
for nota in notas:
soma_notas += nota
else:
media = soma_notas / len(notas)
print(nome, "su... | 24.571429 | 44 | 0.636628 |
a8fb8ceea9aa8192bd5b9922d4f87941ebbe7a71 | 1,819 | py | Python | convoy/api/endpoint.py | frain-dev/convoy-python | 7607a6b65615cc83c38bfb7dba4ad6ed564860bc | [
"MIT"
] | null | null | null | convoy/api/endpoint.py | frain-dev/convoy-python | 7607a6b65615cc83c38bfb7dba4ad6ed564860bc | [
"MIT"
] | null | null | null | convoy/api/endpoint.py | frain-dev/convoy-python | 7607a6b65615cc83c38bfb7dba4ad6ed564860bc | [
"MIT"
] | null | null | null | from convoy.client import Client
class Endpoint():
"""Initializes an Endpoint object to make calls to the /endpoints endpoint.
Parameters
----------
config : dict of config values
"""
def __init__(self, config):
self.client = Client(config)
def all(self, appId, query):
... | 28.421875 | 109 | 0.509621 |
a0f327d757c776d182b964fa9710677cc26cdcb4 | 677 | py | Python | stockTickerAnalysis/scrapers/scrape.py | raghuveermadala/stockTickerAnalysis | a74bb7c854d91c2f61fa1f9f3b0c586304005b04 | [
"MIT"
] | null | null | null | stockTickerAnalysis/scrapers/scrape.py | raghuveermadala/stockTickerAnalysis | a74bb7c854d91c2f61fa1f9f3b0c586304005b04 | [
"MIT"
] | null | null | null | stockTickerAnalysis/scrapers/scrape.py | raghuveermadala/stockTickerAnalysis | a74bb7c854d91c2f61fa1f9f3b0c586304005b04 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
from scrapers import cache
from requests import get
from lxml import html
def scrape_page(url):
"""
Scrapes a web page given a url and returns an HTML tree representation.
This will check for a cachced version of the page before scraping and will attempt to cache
after scraping
... | 27.08 | 95 | 0.695716 |
a14a367f70a25251241e9b66122179bf71bfd5e1 | 2,184 | py | Python | nomadgram/images/models.py | TaeHyoungKwon/nomadgram | 338a2aaa0d8fd957e41f10ae114611e438f6f408 | [
"MIT"
] | null | null | null | nomadgram/images/models.py | TaeHyoungKwon/nomadgram | 338a2aaa0d8fd957e41f10ae114611e438f6f408 | [
"MIT"
] | null | null | null | nomadgram/images/models.py | TaeHyoungKwon/nomadgram | 338a2aaa0d8fd957e41f10ae114611e438f6f408 | [
"MIT"
] | null | null | null | from django.db import models
from django.utils.functional import cached_property
from taggit.managers import TaggableManager
from nomadgram.users import models as user_models
class TimeStampedModel(models.Model):
'''
모든 모델에 공통적으로 사용되는
created_at, updated_at 부분을 따로 추상화 시켜서 추상 클래스화 한다.
'''
created_a... | 29.12 | 116 | 0.666667 |
f2e9743ae7580c70f0ada53651fe8183b863e978 | 5,886 | py | Python | nltk/align/gdfa.py | dmcc/nltk | 33c193d2de3876ca89fb08140557e16f01c79c6f | [
"Apache-2.0"
] | 1 | 2015-01-25T19:20:11.000Z | 2015-01-25T19:20:11.000Z | nltk/align/gdfa.py | dmcc/nltk | 33c193d2de3876ca89fb08140557e16f01c79c6f | [
"Apache-2.0"
] | null | null | null | nltk/align/gdfa.py | dmcc/nltk | 33c193d2de3876ca89fb08140557e16f01c79c6f | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Natural Language Toolkit: GDFA word alignment symmetrization
#
# Copyright (C) 2001-2015 NLTK Project
# Authors: Liling Tan
# URL: <http://nltk.org/>
# For license information, see LICENSE.TXT
import codecs
from collections import defaultdict
def grow_diag_final_and(srclen, trglen, e2f, f2e)... | 43.279412 | 80 | 0.526673 |
6d9b3fd63f0b7a0144844f80438b717e03ff45f7 | 930 | py | Python | Tr4PrFnPredLib/postprocess/DeepGoPostProcess.py | Tr4PrFnPred/TransformerProteinFunctionPredLib | 115dd4105631f96e05409fd9e7f6186ecb5df898 | [
"MIT"
] | 1 | 2021-04-13T21:03:10.000Z | 2021-04-13T21:03:10.000Z | Tr4PrFnPredLib/postprocess/DeepGoPostProcess.py | Tr4PrFnPred/TransformerProteinFunctionPredLib | 115dd4105631f96e05409fd9e7f6186ecb5df898 | [
"MIT"
] | 1 | 2021-04-13T22:27:45.000Z | 2021-04-13T22:27:45.000Z | Tr4PrFnPredLib/postprocess/DeepGoPostProcess.py | Tr4PrFnPred/Tr4PrFnPredLib | 115dd4105631f96e05409fd9e7f6186ecb5df898 | [
"MIT"
] | null | null | null | from .PostProcess import PostProcess
class DeepGoPostProcess(PostProcess):
def __init__(self, terms):
self.terms = terms
def postprocess(self, predictions, **kwargs):
ids = kwargs["ids"]
prot_ids = kwargs["prot_ids"]
deep_preds = {}
for i, j in enumerate(ids):
... | 34.444444 | 90 | 0.53871 |
8550d7566cefc016697e7b66a23973817ea23be8 | 7,109 | py | Python | ansible/venv/lib/python2.7/site-packages/ansible/modules/files/patch.py | gvashchenkolineate/gvashchenkolineate_infra_trytravis | 0fb18850afe0d8609693ba4b23f29c7cda17d97f | [
"MIT"
] | 17 | 2017-06-07T23:15:01.000Z | 2021-08-30T14:32:36.000Z | ansible/ansible/modules/files/patch.py | SergeyCherepanov/ansible | 875711cd2fd6b783c812241c2ed7a954bf6f670f | [
"MIT"
] | 9 | 2017-06-25T03:31:52.000Z | 2021-05-17T23:43:12.000Z | ansible/ansible/modules/files/patch.py | SergeyCherepanov/ansible | 875711cd2fd6b783c812241c2ed7a954bf6f670f | [
"MIT"
] | 3 | 2018-05-26T21:31:22.000Z | 2019-09-28T17:00:45.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2012, Luis Alberto Perez Lazaro <luisperlazaro@gmail.com>
# Copyright: (c) 2015, Jakub Jirutka <jakub@jirutka.cz>
# Copyright: (c) 2017, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future... | 32.610092 | 134 | 0.636658 |
7658ee5d7640d5f4924e1adc305bd8792e904cbc | 15,464 | py | Python | cunt/cmds/init_funcs.py | CallMeBrado/cunt-blockchain | 9b140b7e5541f3baffabe02a55b75d9aeb889999 | [
"Apache-2.0"
] | 7 | 2021-08-09T19:01:51.000Z | 2021-12-09T04:32:09.000Z | cunt/cmds/init_funcs.py | CallMeBrado/cunt-blockchain | 9b140b7e5541f3baffabe02a55b75d9aeb889999 | [
"Apache-2.0"
] | 22 | 2021-08-17T04:12:11.000Z | 2022-03-29T04:10:38.000Z | cunt/cmds/init_funcs.py | CallMeBrado/cunt-blockchain | 9b140b7e5541f3baffabe02a55b75d9aeb889999 | [
"Apache-2.0"
] | 4 | 2021-09-05T12:04:51.000Z | 2022-03-15T08:44:32.000Z | import os
import shutil
from pathlib import Path
from typing import Any, Dict, List, Optional, Tuple
import yaml
from cunt import __version__
from cunt.consensus.coinbase import create_puzzlehash_for_pk
from cunt.ssl.create_ssl import (
ensure_ssl_dirs,
generate_ca_signed_cert,
get_cunt_ca_crt_key,
ma... | 39.85567 | 118 | 0.673176 |
cac6a5d2b1fa734811173ff229e9b4138720bd5d | 311 | py | Python | blog/migrations/0002_remove_post_excerpt.py | AmineAsli/my-personal-blog | 3ced4ec04c0f75d97db2a31d1291a98f6c852699 | [
"MIT"
] | null | null | null | blog/migrations/0002_remove_post_excerpt.py | AmineAsli/my-personal-blog | 3ced4ec04c0f75d97db2a31d1291a98f6c852699 | [
"MIT"
] | null | null | null | blog/migrations/0002_remove_post_excerpt.py | AmineAsli/my-personal-blog | 3ced4ec04c0f75d97db2a31d1291a98f6c852699 | [
"MIT"
] | null | null | null | # Generated by Django 3.2 on 2021-04-21 04:58
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('blog', '0001_initial'),
]
operations = [
migrations.RemoveField(
model_name='post',
name='excerpt',
),
]
| 17.277778 | 45 | 0.572347 |
e27e83d9ddf52fa58c3b7c2f7df6db5d98c010fb | 8,310 | py | Python | tests/parsers/winreg_plugins/windows_version.py | nflexfo/plaso | 5da7aa51c39b593773687fdf20a93ba35fc492b4 | [
"Apache-2.0"
] | 1 | 2020-12-04T10:26:34.000Z | 2020-12-04T10:26:34.000Z | tests/parsers/winreg_plugins/windows_version.py | nflexfo/plaso | 5da7aa51c39b593773687fdf20a93ba35fc492b4 | [
"Apache-2.0"
] | null | null | null | tests/parsers/winreg_plugins/windows_version.py | nflexfo/plaso | 5da7aa51c39b593773687fdf20a93ba35fc492b4 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Tests for the WinVer Windows Registry plugin."""
from __future__ import unicode_literals
import unittest
from dfdatetime import filetime as dfdatetime_filetime
from dfwinreg import definitions as dfwinreg_definitions
from dfwinreg import fake as dfwinreg_fake
from p... | 37.264574 | 80 | 0.724669 |
7c154bd7941e6664ea91468d29e01f725ad32c14 | 2,914 | py | Python | app/auth/views.py | ifaraag/app | d952f0dc58fd703074c19ed3235c1520119baf5f | [
"MIT"
] | null | null | null | app/auth/views.py | ifaraag/app | d952f0dc58fd703074c19ed3235c1520119baf5f | [
"MIT"
] | null | null | null | app/auth/views.py | ifaraag/app | d952f0dc58fd703074c19ed3235c1520119baf5f | [
"MIT"
] | null | null | null | from flask import Blueprint, render_template, redirect, url_for, request, flash
from flask.ext.login import login_required, login_user, logout_user
from werkzeug import check_password_hash, generate_password_hash
from app import db, login_manager, pubnub, app, _callback
from .models import User
from .forms import Logi... | 37.358974 | 133 | 0.630062 |
ed4a13b59ded1610fd43bb3fef06cbbb21bf228f | 618 | py | Python | project1/fabfile.py | g-grilli/django | e13bba288513ba57ba6f3fe4453058de8a05e609 | [
"MIT"
] | null | null | null | project1/fabfile.py | g-grilli/django | e13bba288513ba57ba6f3fe4453058de8a05e609 | [
"MIT"
] | null | null | null | project1/fabfile.py | g-grilli/django | e13bba288513ba57ba6f3fe4453058de8a05e609 | [
"MIT"
] | null | null | null | from fabric.api import run, env, sudo, cd, prefix
env.hosts = ['108.61.241.147']
env.user = 'ggril'
DIR = '/home/ggril/.ssh/django/project1'
VENV = 'source /home/ggril/.virtualenvs/django/bin/activate && source SECRETS.ENV'
def start ():
with cd(DIR):
with prefix(VENV):
run('pm2 start uwsgi -- --ini uwsg... | 22.888889 | 82 | 0.61165 |
1198e10ff3d4853dd9f52d5bd4261cf385a0536a | 2,388 | py | Python | preprocessing/generate_diffs.py | iernest/dfdc_deepfake_challenge | dd36d791d4662400479ceb9aa595cc3a1fee2de7 | [
"MIT"
] | null | null | null | preprocessing/generate_diffs.py | iernest/dfdc_deepfake_challenge | dd36d791d4662400479ceb9aa595cc3a1fee2de7 | [
"MIT"
] | null | null | null | preprocessing/generate_diffs.py | iernest/dfdc_deepfake_challenge | dd36d791d4662400479ceb9aa595cc3a1fee2de7 | [
"MIT"
] | null | null | null | import argparse
import os
os.environ["MKL_NUM_THREADS"] = "1"
os.environ["NUMEXPR_NUM_THREADS"] = "1"
os.environ["OMP_NUM_THREADS"] = "1"
# from skimage.measure import compare_ssim
from skimage.metrics import structural_similarity
from functools import partial
from multiprocessing.pool import Pool
from tqdm import tq... | 32.27027 | 99 | 0.628978 |
c2b551ab63eb757ef7a5f55573dcd5d2347ab39a | 2,767 | py | Python | resume/resume/settings.py | Joyash23/resume-website | 6917c8e00b71d9ec886f72744a6eec10ba484811 | [
"MIT"
] | null | null | null | resume/resume/settings.py | Joyash23/resume-website | 6917c8e00b71d9ec886f72744a6eec10ba484811 | [
"MIT"
] | null | null | null | resume/resume/settings.py | Joyash23/resume-website | 6917c8e00b71d9ec886f72744a6eec10ba484811 | [
"MIT"
] | 7 | 2017-06-07T12:57:49.000Z | 2020-10-17T03:16:41.000Z | """
Django settings for resume project.
Generated by 'django-admin startproject' using Django 1.8.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
# Build paths i... | 25.385321 | 71 | 0.698591 |
c8826c11ba894d29b5f5da0d2bf2ccd20989e161 | 384 | py | Python | schemas/response/transaction_response_schema.py | borko81/parking_system_with_flask | 0ff10422cd1892bcb8c4c6958a159b08c1da919b | [
"MIT"
] | 1 | 2022-01-14T15:31:11.000Z | 2022-01-14T15:31:11.000Z | schemas/response/transaction_response_schema.py | borko81/parking_system_with_flask | 0ff10422cd1892bcb8c4c6958a159b08c1da919b | [
"MIT"
] | 5 | 2021-12-03T13:27:44.000Z | 2021-12-05T11:46:08.000Z | schemas/response/transaction_response_schema.py | borko81/parking_system_with_flask | 0ff10422cd1892bcb8c4c6958a159b08c1da919b | [
"MIT"
] | null | null | null | from marshmallow import Schema, fields
from schemas.response.pay_type_response_schema import PayTypeResponseSchema
class TransactionsSchema(Schema):
id = fields.Integer()
pr_id = fields.Integer()
created_on = fields.DateTime()
transaction_id = fields.Integer()
pay_type = fields.Integer()
paym... | 29.538462 | 75 | 0.755208 |
63edd1fcc3f51b63fe2ebf9cafefd915afc35d2d | 15,006 | py | Python | pysimgame/plotting/manager.py | ScienceGamez/pysimgame | 6c89280441358722efbc63b6d8aa914cbe21575e | [
"WTFPL"
] | null | null | null | pysimgame/plotting/manager.py | ScienceGamez/pysimgame | 6c89280441358722efbc63b6d8aa914cbe21575e | [
"WTFPL"
] | null | null | null | pysimgame/plotting/manager.py | ScienceGamez/pysimgame | 6c89280441358722efbc63b6d8aa914cbe21575e | [
"WTFPL"
] | null | null | null | """plots models for ills fate.
The Graph manager handles plots creations and transfer of data from
the model.
Different plots window can be created:
- Parameters evolution graph. Can plot the parameters of a model
though time.
- Regions evolution graph. Plot the same parameter across regions.
- Reg... | 33.873589 | 81 | 0.584833 |
a8917b64c57890f40ab57686b3c31d62b411ca9b | 4,283 | py | Python | RecoHI/HiJetAlgos/python/HiRecoPFJets_cff.py | AlexDroll/cmssw | ef485116d14d07f9c9e591c01b4597c1c9a967cb | [
"Apache-2.0"
] | null | null | null | RecoHI/HiJetAlgos/python/HiRecoPFJets_cff.py | AlexDroll/cmssw | ef485116d14d07f9c9e591c01b4597c1c9a967cb | [
"Apache-2.0"
] | null | null | null | RecoHI/HiJetAlgos/python/HiRecoPFJets_cff.py | AlexDroll/cmssw | ef485116d14d07f9c9e591c01b4597c1c9a967cb | [
"Apache-2.0"
] | null | null | null | import FWCore.ParameterSet.Config as cms
## Default Parameter Sets
from RecoJets.JetProducers.AnomalousCellParameters_cfi import *
from RecoHI.HiJetAlgos.HiPFJetParameters_cff import *
#pseudo towers for noise suppression background subtraction
import RecoHI.HiJetAlgos.particleTowerProducer_cfi as _mod
PFTowers = _mo... | 35.106557 | 100 | 0.644175 |
8dc4f3c19e212c1c4ed9233d78cf6316cbac9765 | 1,706 | py | Python | sdk/test/test_core_product.py | DarrahK/yapily-sdk-python | 2dcf9a403feafab7dcaf140dabe61794bd4debd3 | [
"MIT"
] | null | null | null | sdk/test/test_core_product.py | DarrahK/yapily-sdk-python | 2dcf9a403feafab7dcaf140dabe61794bd4debd3 | [
"MIT"
] | null | null | null | sdk/test/test_core_product.py | DarrahK/yapily-sdk-python | 2dcf9a403feafab7dcaf140dabe61794bd4debd3 | [
"MIT"
] | null | null | null | # coding: utf-8
"""
Yapily API
To access endpoints that require authentication, use your application key and secret created in the Dashboard (https://dashboard.yapily.com) # noqa: E501
The version of the OpenAPI document: 1.157.0
Generated by: https://openapi-generator.tech
"""
from __future__ imp... | 27.516129 | 158 | 0.606682 |
e93c4a75547dfda8a250d0359729c8d057515334 | 1,251 | py | Python | examples/development/__init__.py | YaoYao1995/mbpo | b9571e469459ce3a632b19dc3fee68c9ac3857b2 | [
"MIT"
] | null | null | null | examples/development/__init__.py | YaoYao1995/mbpo | b9571e469459ce3a632b19dc3fee68c9ac3857b2 | [
"MIT"
] | null | null | null | examples/development/__init__.py | YaoYao1995/mbpo | b9571e469459ce3a632b19dc3fee68c9ac3857b2 | [
"MIT"
] | null | null | null | """Provides functions that are utilized by the command line interface.
In particular, the examples are exposed to the command line interface
(defined in `softlearning.scripts.console_scripts`) through the
`get_trainable_class`, `get_variant_spec`, and `get_parser` functions.
"""
def get_trainable_class(*args... | 32.921053 | 80 | 0.748201 |
2aedcc8a0cb213a20c24bc71bf516f9cccb9a9b7 | 3,504 | py | Python | src/Preprocessor.py | cetinsamet/movie-genre-classification | d52088210cbd371846063ebdccc5a77c4582deaf | [
"MIT"
] | 2 | 2019-09-01T13:03:05.000Z | 2020-09-12T06:04:05.000Z | src/Preprocessor.py | cetinsamet/movie-genre-classification | d52088210cbd371846063ebdccc5a77c4582deaf | [
"MIT"
] | null | null | null | src/Preprocessor.py | cetinsamet/movie-genre-classification | d52088210cbd371846063ebdccc5a77c4582deaf | [
"MIT"
] | 2 | 2019-05-20T08:10:27.000Z | 2021-04-26T06:51:12.000Z | #
# Preprocessor.py
#
# Created by Samet Cetin.
# Contact: cetin.samet@outlook.com
#
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import nltk
import os
from nltk.corpus import stopwords
import codecs
import errno
import string
class Preprocessor:
def __init__(self, dataset_directory="Dataset", processed_dataset... | 40.744186 | 109 | 0.619292 |
e462208fdb4b19a47ea33a1ed25429fe663f2254 | 1,747 | py | Python | elzzur/snake.py | aogier/elzzur | 4d3c5afa24226b4c4bad193afeaba1ebbef2f6b6 | [
"MIT"
] | 3 | 2016-06-27T14:15:14.000Z | 2019-08-15T04:35:48.000Z | elzzur/snake.py | aogier/elzzur | 4d3c5afa24226b4c4bad193afeaba1ebbef2f6b6 | [
"MIT"
] | null | null | null | elzzur/snake.py | aogier/elzzur | 4d3c5afa24226b4c4bad193afeaba1ebbef2f6b6 | [
"MIT"
] | 1 | 2019-02-15T08:10:15.000Z | 2019-02-15T08:10:15.000Z | #!/usr/bin/env python
# coding=utf-8
"""
A Snake represents a (possibly partial) list of adjacent board cells,
represented by ``(x, y)`` pairs, 0-indexing.
"""
from __future__ import absolute_import
from __future__ import print_function
__author__ = "Alberto Pettarin"
__copyright__ = "Copyright 2016, Alberto Pettari... | 23.931507 | 83 | 0.593017 |
00cd6222230d848e84cd4370fc1053335fb668e0 | 37,922 | py | Python | psychrnn/backend/rnn.py | tianw6/PsychRNN | 8d874002d83916f9cc687d1313cfb2f9c15e57f9 | [
"MIT"
] | 90 | 2020-05-25T05:29:13.000Z | 2022-03-29T15:49:12.000Z | psychrnn/backend/rnn.py | tianw6/PsychRNN | 8d874002d83916f9cc687d1313cfb2f9c15e57f9 | [
"MIT"
] | 26 | 2020-06-23T20:03:25.000Z | 2021-08-05T08:44:37.000Z | psychrnn/backend/rnn.py | tianw6/PsychRNN | 8d874002d83916f9cc687d1313cfb2f9c15e57f9 | [
"MIT"
] | 28 | 2020-05-25T05:29:04.000Z | 2022-03-29T11:39:05.000Z | from __future__ import division
from __future__ import print_function
from abc import ABCMeta, abstractmethod
# abstract class python 2 & 3 compatible
ABC = ABCMeta('ABC', (object,), {})
import tensorflow as tf
import numpy as np
import sys
from time import time
from os import makedirs, path
from inspect import isg... | 57.370651 | 420 | 0.548573 |
9c1f62f375fa63bc3da4282a11208fe77cc53dbe | 35,393 | py | Python | private/dump_new_fish_data.py | Lodinn/ff14-fish-tracker-app | ff96fea17f4ffa5f77013c5f31d04a53b54f8123 | [
"MIT"
] | null | null | null | private/dump_new_fish_data.py | Lodinn/ff14-fish-tracker-app | ff96fea17f4ffa5f77013c5f31d04a53b54f8123 | [
"MIT"
] | null | null | null | private/dump_new_fish_data.py | Lodinn/ff14-fish-tracker-app | ff96fea17f4ffa5f77013c5f31d04a53b54f8123 | [
"MIT"
] | null | null | null | from typing import Dict, Any, List, Iterable
from dataclasses import make_dataclass, field
import logging
import sys
import os
import re
from itertools import chain, filterfalse, islice, repeat
from functools import reduce
from operator import add, itemgetter
import timeit
from tqdm import tqdm
try:
_SCRIPT_PATH ... | 38.850714 | 109 | 0.593959 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.