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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f74c059847d4f3d24b4e90875b2b8f93318aff9a | 5,668 | py | Python | src/cryptography_patched/hazmat/primitives/padding.py | thatch/cryptography | 0bdcf3d62bcb2051f82a39daf46cc67e43a8f465 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | src/cryptography_patched/hazmat/primitives/padding.py | thatch/cryptography | 0bdcf3d62bcb2051f82a39daf46cc67e43a8f465 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | src/cryptography_patched/hazmat/primitives/padding.py | thatch/cryptography | 0bdcf3d62bcb2051f82a39daf46cc67e43a8f465 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | # This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
import abc
import six
from cryptography_patched import utils
from crypt... | 28.199005 | 79 | 0.674841 |
from __future__ import absolute_import, division, print_function
import abc
import six
from cryptography_patched import utils
from cryptography_patched.exceptions import AlreadyFinalized
from cryptography_patched.hazmat.bindings._padding import lib
@six.add_metaclass(abc.ABCMeta)
class PaddingContext(object):
... | true | true |
f74c05ab0ebe042cb91b74c2490f0e0a895ef769 | 5,110 | py | Python | python/TetrisDRL.py | AlexLJC/MLTetris | dc47321746bcd67989cb7190941827c317036d6b | [
"MIT"
] | null | null | null | python/TetrisDRL.py | AlexLJC/MLTetris | dc47321746bcd67989cb7190941827c317036d6b | [
"MIT"
] | null | null | null | python/TetrisDRL.py | AlexLJC/MLTetris | dc47321746bcd67989cb7190941827c317036d6b | [
"MIT"
] | null | null | null | # Import
import tensorflow as tf
import numpy as np
import pandas as pd
from collections import deque
import random
import tetris as tetris
# Hyperparameter
num_episodes = 500
num_exploration_episodes = 100
max_len_episode = 1000
batch_size = 40
learning_rate = 0.005
gamma = 0.95
initial_epsilon = 1.0
final_epsilo... | 32.75641 | 107 | 0.584932 | import tensorflow as tf
import numpy as np
import pandas as pd
from collections import deque
import random
import tetris as tetris
num_episodes = 500
num_exploration_episodes = 100
max_len_episode = 1000
batch_size = 40
learning_rate = 0.005
gamma = 0.95
initial_epsilon = 1.0
final_epsilon = 0.01
eps_decay = 0.995... | true | true |
f74c06bbc00ae4a707dfcebf719e9a954e7ac26a | 930 | py | Python | libs/imutils/feature/rootsift.py | rocketbot-cl/recognition | cca8a87070ccaca3a26e37345c36ab1bf836e258 | [
"MIT"
] | 6 | 2019-10-17T18:16:17.000Z | 2021-10-04T08:10:30.000Z | libs/imutils/feature/rootsift.py | rocketbot-cl/recognition | cca8a87070ccaca3a26e37345c36ab1bf836e258 | [
"MIT"
] | null | null | null | libs/imutils/feature/rootsift.py | rocketbot-cl/recognition | cca8a87070ccaca3a26e37345c36ab1bf836e258 | [
"MIT"
] | 3 | 2020-09-10T12:03:20.000Z | 2021-04-26T13:19:53.000Z | # import the necessary packages
from __future__ import absolute_import
import numpy as np
import cv2
from ..convenience import is_cv2
class RootSIFT:
def __init__(self):
# initialize the SIFT feature extractor for OpenCV 2.4
if is_cv2():
self.extractor = cv2.DescriptorExtractor_create("SIFT")
# ... | 30 | 70 | 0.706452 | from __future__ import absolute_import
import numpy as np
import cv2
from ..convenience import is_cv2
class RootSIFT:
def __init__(self):
if is_cv2():
self.extractor = cv2.DescriptorExtractor_create("SIFT")
else:
self.extractor = cv2.xfeatures2d.SIFT_create()
def compute(self, image, kps... | true | true |
f74c06c1b4b99f15be38c16bb8537a174d705ec3 | 7,306 | py | Python | rlstructures/deprecated/batchers/buffers.py | Purple-PI/rlstructures | 9b201b083715bbda2f3534b010c84e11dfc0a1c7 | [
"MIT"
] | 281 | 2021-01-13T14:20:23.000Z | 2022-03-23T08:46:56.000Z | rlstructures/deprecated/batchers/buffers.py | Purple-PI/rlstructures | 9b201b083715bbda2f3534b010c84e11dfc0a1c7 | [
"MIT"
] | 2 | 2021-01-22T23:28:34.000Z | 2021-04-29T22:05:42.000Z | rlstructures/deprecated/batchers/buffers.py | Purple-PI/rlstructures | 9b201b083715bbda2f3534b010c84e11dfc0a1c7 | [
"MIT"
] | 13 | 2021-01-15T14:53:32.000Z | 2022-03-22T11:12:54.000Z | #
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
#
import torch
import torch.multiprocessing as mp
from rlstructures import TemporalDictTensor, DictTensor
class Buffer:
def get_free_... | 33.209091 | 107 | 0.564057 |
import torch
import torch.multiprocessing as mp
from rlstructures import TemporalDictTensor, DictTensor
class Buffer:
def get_free_slots(self, k):
raise NotImplementedError
def set_free_slots(self, s):
raise NotImplementedError
def write(self, slots, variables):
raise NotImplem... | true | true |
f74c074dd81c06f3ec1b63fb6e0bdaedbf6a4e71 | 12,312 | py | Python | mainUi.py | RastogiAbhijeet/NewsReader | 6b2edae53fc6bd50237d865bd45c039384e0dd23 | [
"MIT"
] | 1 | 2017-10-16T05:00:23.000Z | 2017-10-16T05:00:23.000Z | mainUi.py | RastogiAbhijeet/NewsReader | 6b2edae53fc6bd50237d865bd45c039384e0dd23 | [
"MIT"
] | null | null | null | mainUi.py | RastogiAbhijeet/NewsReader | 6b2edae53fc6bd50237d865bd45c039384e0dd23 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'haha.ui'
#
# Created by: PyQt5 UI code generator 5.6
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
from databaseHandling import InterfaceClass
from webcam.webcam import Webcam
... | 49.248 | 131 | 0.68884 |
from PyQt5 import QtCore, QtGui, QtWidgets
from databaseHandling import InterfaceClass
from webcam.webcam import Webcam
import sys
import time
class Ui_MainWindow(object):
def __init__(self):
self.databaseObj = InterfaceClass()
self.fetchDataList = []
self.counterForNews = 0... | true | true |
f74c086c94a6a313b3f805c0b323870dfb7bef08 | 8,815 | py | Python | jacket/tests/storage/unit/api/contrib/test_volume_encryption_metadata.py | bopopescu/jacket | d7ad3147fcb43131098c2a5210847634ff5fb325 | [
"Apache-2.0"
] | null | null | null | jacket/tests/storage/unit/api/contrib/test_volume_encryption_metadata.py | bopopescu/jacket | d7ad3147fcb43131098c2a5210847634ff5fb325 | [
"Apache-2.0"
] | null | null | null | jacket/tests/storage/unit/api/contrib/test_volume_encryption_metadata.py | bopopescu/jacket | d7ad3147fcb43131098c2a5210847634ff5fb325 | [
"Apache-2.0"
] | 2 | 2016-08-10T02:21:49.000Z | 2020-07-24T01:57:21.000Z | # Copyright (c) 2013 The Johns Hopkins University/Applied Physics Laboratory
# 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/... | 41.777251 | 80 | 0.603063 |
from oslo_serialization import jsonutils
import webob
from jacket.api.storage.storage.contrib import volume_encryption_metadata
from jacket import context
from jacket import db
from jacket.storage import test
from jacket.tests.storage.unit.api import fakes
def return_volume_type_encryption_metadata(context, volume_... | true | true |
f74c08de00b0062dd6f24feebd0136cbdc539830 | 2,262 | py | Python | 05_extract_retweets.py | tuchandra/echo-chambers | 4f5bbbb213f0711614080773821f57c9b351dea6 | [
"MIT"
] | 4 | 2018-09-14T07:46:51.000Z | 2020-11-04T03:43:11.000Z | 05_extract_retweets.py | tuchandra/echo-chambers | 4f5bbbb213f0711614080773821f57c9b351dea6 | [
"MIT"
] | null | null | null | 05_extract_retweets.py | tuchandra/echo-chambers | 4f5bbbb213f0711614080773821f57c9b351dea6 | [
"MIT"
] | 2 | 2019-04-12T21:47:18.000Z | 2020-11-23T17:56:17.000Z | """Extract retweets by date from all of the tweets in collection.
Creates a CSV for each date, and includes the IDs of tweets that were
retweeted on that date. Format is
(tweet_date, ID of the retweet, ID of original tweet)
with the date formatted as YYYY_MM_DD.
This script assumes:
- MongoDB is listenin... | 31.416667 | 109 | 0.608753 |
import csv
import os
import time
import pymongo
def export_retweets(client, collection_name):
col = client["twitter"][collection_name]
retweets = {}
for i, tweet in enumerate(col.find({"retweeted_status": {"$exists" : True}}, no_cursor_timeout = True)):
if i % 50000 == 0:
... | true | true |
f74c0ab23ab9ad6a46db773081ad376999262411 | 268 | py | Python | tests/artificial/transf_BoxCox/trend_ConstantTrend/cycle_30/ar_12/test_artificial_1024_BoxCox_ConstantTrend_30_12_20.py | shaido987/pyaf | b9afd089557bed6b90b246d3712c481ae26a1957 | [
"BSD-3-Clause"
] | 377 | 2016-10-13T20:52:44.000Z | 2022-03-29T18:04:14.000Z | tests/artificial/transf_BoxCox/trend_ConstantTrend/cycle_30/ar_12/test_artificial_1024_BoxCox_ConstantTrend_30_12_20.py | ysdede/pyaf | b5541b8249d5a1cfdc01f27fdfd99b6580ed680b | [
"BSD-3-Clause"
] | 160 | 2016-10-13T16:11:53.000Z | 2022-03-28T04:21:34.000Z | tests/artificial/transf_BoxCox/trend_ConstantTrend/cycle_30/ar_12/test_artificial_1024_BoxCox_ConstantTrend_30_12_20.py | ysdede/pyaf | b5541b8249d5a1cfdc01f27fdfd99b6580ed680b | [
"BSD-3-Clause"
] | 63 | 2017-03-09T14:51:18.000Z | 2022-03-27T20:52:57.000Z | import pyaf.Bench.TS_datasets as tsds
import tests.artificial.process_artificial_dataset as art
art.process_dataset(N = 1024 , FREQ = 'D', seed = 0, trendtype = "ConstantTrend", cycle_length = 30, transform = "BoxCox", sigma = 0.0, exog_count = 20, ar_order = 12); | 38.285714 | 168 | 0.735075 | import pyaf.Bench.TS_datasets as tsds
import tests.artificial.process_artificial_dataset as art
art.process_dataset(N = 1024 , FREQ = 'D', seed = 0, trendtype = "ConstantTrend", cycle_length = 30, transform = "BoxCox", sigma = 0.0, exog_count = 20, ar_order = 12); | true | true |
f74c0bd123d1b7fe983ce716b92aead43629a1c5 | 91 | py | Python | test/run/t191.py | timmartin/skulpt | 2e3a3fbbaccc12baa29094a717ceec491a8a6750 | [
"MIT"
] | 2,671 | 2015-01-03T08:23:25.000Z | 2022-03-31T06:15:48.000Z | test/run/t191.py | timmartin/skulpt | 2e3a3fbbaccc12baa29094a717ceec491a8a6750 | [
"MIT"
] | 972 | 2015-01-05T08:11:00.000Z | 2022-03-29T13:47:15.000Z | test/run/t191.py | timmartin/skulpt | 2e3a3fbbaccc12baa29094a717ceec491a8a6750 | [
"MIT"
] | 845 | 2015-01-03T19:53:36.000Z | 2022-03-29T18:34:22.000Z | def f():
for i in 1,2,3,4,5:
if i == 3: break
yield i
print list(f())
| 15.166667 | 24 | 0.43956 | def f():
for i in 1,2,3,4,5:
if i == 3: break
yield i
print list(f())
| false | true |
f74c0bdf102f3629f64a6c97a1ab1e1ec85dc87f | 2,147 | py | Python | conans/test/unittests/client/generators/text_test.py | johnmcfarlane/conan | 725bd0cee4e53f35521aef7eeb61d4772c460d5e | [
"MIT"
] | null | null | null | conans/test/unittests/client/generators/text_test.py | johnmcfarlane/conan | 725bd0cee4e53f35521aef7eeb61d4772c460d5e | [
"MIT"
] | 4 | 2018-09-05T13:08:31.000Z | 2020-03-05T09:17:20.000Z | conans/test/unittests/client/generators/text_test.py | johnmcfarlane/conan | 725bd0cee4e53f35521aef7eeb61d4772c460d5e | [
"MIT"
] | 2 | 2018-09-05T11:58:44.000Z | 2018-09-05T12:14:11.000Z | # coding=utf-8
import textwrap
import unittest
from conans.client.generators.text import TXTGenerator
from conans.model.build_info import CppInfo
from conans.model.conan_file import ConanFile
from conans.model.env_info import EnvValues
from conans.model.ref import ConanFileReference
from conans.model.settings import S... | 33.030769 | 97 | 0.667443 | import textwrap
import unittest
from conans.client.generators.text import TXTGenerator
from conans.model.build_info import CppInfo
from conans.model.conan_file import ConanFile
from conans.model.env_info import EnvValues
from conans.model.ref import ConanFileReference
from conans.model.settings import Settings
from co... | true | true |
f74c0cf5996cfd74aab4e926b9539a3e961c79cb | 19,309 | py | Python | python/tensorflowjs/converters/keras_h5_conversion_test.py | pvaneck/tfjs-converter | 074ed3252fab3d913679d5415a5e530efd4966b3 | [
"Apache-2.0"
] | null | null | null | python/tensorflowjs/converters/keras_h5_conversion_test.py | pvaneck/tfjs-converter | 074ed3252fab3d913679d5415a5e530efd4966b3 | [
"Apache-2.0"
] | null | null | null | python/tensorflowjs/converters/keras_h5_conversion_test.py | pvaneck/tfjs-converter | 074ed3252fab3d913679d5415a5e530efd4966b3 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 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 or agreed to in writing, s... | 42.251641 | 80 | 0.693045 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import json
import os
import shutil
import tempfile
import unittest
import h5py
import keras
import numpy as np
import tensorflow as tf
from tensorflowjs.converters import keras_h5_conversion as conversion
... | true | true |
f74c0d11213332b2628bbb87a29add87c2105dd4 | 1,308 | py | Python | app.py | Dijereo/VersuSpace | 6d74581d04b7409fad768c51c20334ac85f3ecf0 | [
"MIT"
] | 1 | 2020-07-03T00:33:19.000Z | 2020-07-03T00:33:19.000Z | app.py | Dijereo/VersuSpace | 6d74581d04b7409fad768c51c20334ac85f3ecf0 | [
"MIT"
] | null | null | null | app.py | Dijereo/VersuSpace | 6d74581d04b7409fad768c51c20334ac85f3ecf0 | [
"MIT"
] | null | null | null | from game_screen import *
class App:
def __init__(self, width, height):
self.width = width
self.height = height
self.window = pygame.display.set_mode((self.width, self.height))
pygame.display.set_caption('VersuSpace')
self.running = True
self.quit_listener = AppQuit... | 31.142857 | 72 | 0.654434 | from game_screen import *
class App:
def __init__(self, width, height):
self.width = width
self.height = height
self.window = pygame.display.set_mode((self.width, self.height))
pygame.display.set_caption('VersuSpace')
self.running = True
self.quit_listener = AppQuit... | true | true |
f74c0e4694b9bd0dea312456e4ada9d2a0721982 | 1,943 | py | Python | mod_updater/sources/curse_forge.py | snallapa/mod_updater | 783ddf09da9d3909ce3d466f148218dbc51e29c9 | [
"MIT"
] | null | null | null | mod_updater/sources/curse_forge.py | snallapa/mod_updater | 783ddf09da9d3909ce3d466f148218dbc51e29c9 | [
"MIT"
] | 1 | 2021-05-15T20:08:33.000Z | 2021-05-22T21:19:41.000Z | mod_updater/sources/curse_forge.py | snallapa/mod_updater | 783ddf09da9d3909ce3d466f148218dbc51e29c9 | [
"MIT"
] | null | null | null | from .base import DownloadSource
import requests
from mod_updater.util.utils import TermColors
class CurseForgeSource(DownloadSource):
REQUIRED_ARGS = ["project_id"]
OPTIONAL_ARGS = [("release_type", "release")]
def __init__(self, project, release_type, path, mc_version):
self._file_data_url =... | 44.159091 | 123 | 0.644879 | from .base import DownloadSource
import requests
from mod_updater.util.utils import TermColors
class CurseForgeSource(DownloadSource):
REQUIRED_ARGS = ["project_id"]
OPTIONAL_ARGS = [("release_type", "release")]
def __init__(self, project, release_type, path, mc_version):
self._file_data_url =... | true | true |
f74c0e8316a30ad4fbb2a6fc893e3a723310b2b9 | 2,565 | py | Python | pychron/core/select_same.py | ael-noblegas/pychron | 6ebbbb1f66a614972b62b7a9be4c784ae61b5d62 | [
"Apache-2.0"
] | null | null | null | pychron/core/select_same.py | ael-noblegas/pychron | 6ebbbb1f66a614972b62b7a9be4c784ae61b5d62 | [
"Apache-2.0"
] | 80 | 2018-07-17T20:10:20.000Z | 2021-08-17T15:38:24.000Z | pychron/core/select_same.py | UManPychron/pychron | b84c9fd70072f9cbda30abe2c471e64fe3dd75d8 | [
"Apache-2.0"
] | null | null | null | # ===============================================================================
# Copyright 2018 ross
#
# 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/LICE... | 33.311688 | 83 | 0.59961 | from pyface.message_dialog import warning
from traits.api import HasTraits, List
from traitsui.api import UItem, CheckListEditor
from pychron.core.helpers.traitsui_shortcuts import okcancel_view
class SelectSameMixin(HasTraits):
default_attr = None
def select_same_attr(self):
hs = self._get_selectio... | true | true |
f74c0f7c5299c9b19c626e876cbf83c9df136259 | 16,061 | py | Python | SloppyCell/Vandermonde/OptimizeSumDets.py | robertvsiii/sloppycell | caf6daa09f2202acccf26ad31890fddaf4af82e8 | [
"BSD-3-Clause"
] | null | null | null | SloppyCell/Vandermonde/OptimizeSumDets.py | robertvsiii/sloppycell | caf6daa09f2202acccf26ad31890fddaf4af82e8 | [
"BSD-3-Clause"
] | 1 | 2019-04-15T21:08:12.000Z | 2019-04-15T21:08:12.000Z | SloppyCell/Vandermonde/OptimizeSumDets.py | jurquiza/SloppyCellUrquiza2019 | a9f64d9d4172c82735813f09e48f36777a714e9c | [
"BSD-3-Clause"
] | null | null | null | import scipy
import time
try:
import SloppyCell.Plotting as Plotting
except ImportError:
pass
def C(p, origMatrix, weightsRDP=0.,weights2D=0.,weightsLS=0.,weightPR=0.,weightPriors=0.,*args,**kwargs):
"""
p is list {a_{ij}, i: 1..n, j: i+1..n}
n is size of total matrix
"""
n = origMatrix.sha... | 36.75286 | 167 | 0.687566 | import scipy
import time
try:
import SloppyCell.Plotting as Plotting
except ImportError:
pass
def C(p, origMatrix, weightsRDP=0.,weights2D=0.,weightsLS=0.,weightPR=0.,weightPriors=0.,*args,**kwargs):
"""
p is list {a_{ij}, i: 1..n, j: i+1..n}
n is size of total matrix
"""
n = origMatrix.sha... | false | true |
f74c0f85bdb807bfb2f5ccc7afb32b59bf88a662 | 4,619 | py | Python | retroprime/data_process/clean_uspto.py | wangxr0526/RetroPrime | a765b670b72fbfd512d0d437da8f27a95f9f0554 | [
"MIT"
] | 12 | 2020-09-30T11:16:42.000Z | 2022-03-09T08:12:48.000Z | retroprime/data_process/clean_uspto.py | wangxr0526/RetroPrime | a765b670b72fbfd512d0d437da8f27a95f9f0554 | [
"MIT"
] | 2 | 2021-12-14T13:06:33.000Z | 2022-03-29T03:04:44.000Z | retroprime/data_process/clean_uspto.py | wangxr0526/RetroPrime | a765b670b72fbfd512d0d437da8f27a95f9f0554 | [
"MIT"
] | 1 | 2021-02-01T07:30:07.000Z | 2021-02-01T07:30:07.000Z | from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
import argparse
import numpy as np
import random
import csv
import os
import sys
import re
from tqdm import tqdm
from rdkit import Chem
import pickle as cp
def get_rxn_smiles(prod, reactants):
prod_smi =... | 34.470149 | 103 | 0.546872 | from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
import argparse
import numpy as np
import random
import csv
import os
import sys
import re
from tqdm import tqdm
from rdkit import Chem
import pickle as cp
def get_rxn_smiles(prod, reactants):
prod_smi =... | true | true |
f74c0fd3d88eb3915277530b9c87a5261744b80d | 14,456 | py | Python | Core/asm.py | Cwiiis/gigatron-rom | 60fee9ef4daa41c2bbdff26eb9b7f8d4e564e1e3 | [
"BSD-2-Clause"
] | null | null | null | Core/asm.py | Cwiiis/gigatron-rom | 60fee9ef4daa41c2bbdff26eb9b7f8d4e564e1e3 | [
"BSD-2-Clause"
] | null | null | null | Core/asm.py | Cwiiis/gigatron-rom | 60fee9ef4daa41c2bbdff26eb9b7f8d4e564e1e3 | [
"BSD-2-Clause"
] | null | null | null |
# SYNOPSIS: from asm import *
from os.path import basename, splitext
from sys import argv
# Module variables because I don't feel like making a class
_romSize, _maxRomSize, _zpSize = 0, 0, 1
_symbols, _refsL, _refsH = {}, [], []
_labels = {} # Inverse of _symbols, but only when made with label(). For disassembler
_c... | 32.412556 | 109 | 0.604247 |
from os.path import basename, splitext
from sys import argv
_romSize, _maxRomSize, _zpSize = 0, 0, 1
_symbols, _refsL, _refsH = {}, [], []
_labels = {} # Inverse of _symbols, but only when made with label(). For disassembler
_comments = {}
_rom0, _rom1 = [], []
# Bus access
busD = 0
busRAM = 1
busAC = 2
busIN =... | false | true |
f74c105a2256b26683496be1da1c986b0606308b | 998 | py | Python | taskbuster/taskbuster/urls.py | memnonila/taskbuster-boilerplate | 7c1313d567d983e8c569c5d826fa9b1508eebc00 | [
"MIT"
] | null | null | null | taskbuster/taskbuster/urls.py | memnonila/taskbuster-boilerplate | 7c1313d567d983e8c569c5d826fa9b1508eebc00 | [
"MIT"
] | null | null | null | taskbuster/taskbuster/urls.py | memnonila/taskbuster-boilerplate | 7c1313d567d983e8c569c5d826fa9b1508eebc00 | [
"MIT"
] | null | null | null | """taskbuster URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-... | 34.413793 | 85 | 0.702405 | from django.conf.urls import include, url
from django.contrib import admin
from django.conf.urls.i18n import i18n_patterns
from .views import home, home_files
urlpatterns = [
url(r'^(?P<filename>(robots.txt)|(humans.txt))$', home_files, name='home-files'),
]
urlpatterns += i18n_patterns(
url(r'^admin/', inclu... | true | true |
f74c13916239b36c6f00b2b24c2c8c0b59d3209a | 388 | py | Python | setup.py | BehindLoader/py2ch | a79f877ad6d4bb526d2476c12e9d340178da2170 | [
"MIT"
] | 5 | 2019-08-05T12:06:33.000Z | 2019-09-10T07:25:00.000Z | setup.py | BehindLoader/pych | a79f877ad6d4bb526d2476c12e9d340178da2170 | [
"MIT"
] | 16 | 2019-08-05T12:18:59.000Z | 2019-08-14T20:21:08.000Z | setup.py | BehindLoader/pych | a79f877ad6d4bb526d2476c12e9d340178da2170 | [
"MIT"
] | null | null | null | """Setup py2ch application."""
from os.path import dirname, join
from setuptools import setup
version = '1.0'
setup(
name='pych',
author='BehindLoader',
version=version,
packages=['pych'],
license='MIT',
description='Python 2ch API client.',
long_description=open(join(dirname(__file__), ... | 20.421053 | 72 | 0.664948 |
from os.path import dirname, join
from setuptools import setup
version = '1.0'
setup(
name='pych',
author='BehindLoader',
version=version,
packages=['pych'],
license='MIT',
description='Python 2ch API client.',
long_description=open(join(dirname(__file__), 'README.rst')).read(),
inst... | true | true |
f74c14228a11f128426330bfa8edd7bde452e16f | 799 | py | Python | code/resnet_approach/prepare.py | liuchangtai1996/MLIP | ec217d592b8c51e98729d8c2b2abe1b2d918e14f | [
"MIT"
] | null | null | null | code/resnet_approach/prepare.py | liuchangtai1996/MLIP | ec217d592b8c51e98729d8c2b2abe1b2d918e14f | [
"MIT"
] | null | null | null | code/resnet_approach/prepare.py | liuchangtai1996/MLIP | ec217d592b8c51e98729d8c2b2abe1b2d918e14f | [
"MIT"
] | null | null | null | import numpy as np
import cv2
def load_batch(ls,od,data_path,batch_size,which_batch):
image_list=[]
for i in range(which_batch*batch_size,(which_batch+1)*batch_size):
image=[]
image.append(cv2.imread(data_path+ls[od[i]]+'_red.png',0))
image.append(cv2.imread(data_path+ls[od[i]]+... | 34.73913 | 71 | 0.649562 | import numpy as np
import cv2
def load_batch(ls,od,data_path,batch_size,which_batch):
image_list=[]
for i in range(which_batch*batch_size,(which_batch+1)*batch_size):
image=[]
image.append(cv2.imread(data_path+ls[od[i]]+'_red.png',0))
image.append(cv2.imread(data_path+ls[od[i]]+... | true | true |
f74c142e999a01e927a8a4f60ee35ed27ce20342 | 1,416 | py | Python | enumchoicefield/utils.py | heckad/django-enumchoicefield | 59e230f8eed086c87ac6a9243448d2cd9adfc250 | [
"BSD-2-Clause"
] | null | null | null | enumchoicefield/utils.py | heckad/django-enumchoicefield | 59e230f8eed086c87ac6a9243448d2cd9adfc250 | [
"BSD-2-Clause"
] | null | null | null | enumchoicefield/utils.py | heckad/django-enumchoicefield | 59e230f8eed086c87ac6a9243448d2cd9adfc250 | [
"BSD-2-Clause"
] | 2 | 2019-01-17T06:43:09.000Z | 2019-02-21T23:27:01.000Z | from __future__ import absolute_import, unicode_literals
from django.db.models import Case, IntegerField, When
def order_enum(field, members):
"""
Make an annotation value that can be used to sort by an enum field.
``field``
The name of an EnumChoiceField.
``members``
An iterable of... | 28.32 | 71 | 0.637006 | from __future__ import absolute_import, unicode_literals
from django.db.models import Case, IntegerField, When
def order_enum(field, members):
members = list(members)
return Case(
*(When(**{field: member, 'then': i})
for i, member in enumerate(members)),
default=len(members),
... | true | true |
f74c14745810433c772c64e6f2859dfcd8ca1535 | 455 | py | Python | category/migrations/0002_auto_20180212_2213.py | Ortus-Team/Moim | 57bdd94ffb0c3b5d7dc74396264074e2a9a7f84a | [
"MIT"
] | null | null | null | category/migrations/0002_auto_20180212_2213.py | Ortus-Team/Moim | 57bdd94ffb0c3b5d7dc74396264074e2a9a7f84a | [
"MIT"
] | 6 | 2020-06-05T17:44:24.000Z | 2022-02-09T23:15:16.000Z | category/migrations/0002_auto_20180212_2213.py | Ortus-Team/Moim | 57bdd94ffb0c3b5d7dc74396264074e2a9a7f84a | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.6 on 2018-02-12 22:13
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('category', '0001_initial'),
]
operations = [
migrations.AlterField(
... | 21.666667 | 63 | 0.613187 | from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('category', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='category',
name='title',
field=m... | true | true |
f74c15740983b6f7b7d3e9d971c759b911ca5ee1 | 15,079 | py | Python | behavioural_planner.py | 19tony97/Autonomous_vheicle_drivingProject | 3938b132e11f7705bff2c2004ee80e1f87438565 | [
"MIT"
] | 3 | 2021-07-06T07:55:03.000Z | 2022-02-03T12:03:52.000Z | behavioural_planner.py | 19tony97/Autonomous_vheicle_drivingProject | 3938b132e11f7705bff2c2004ee80e1f87438565 | [
"MIT"
] | null | null | null | behavioural_planner.py | 19tony97/Autonomous_vheicle_drivingProject | 3938b132e11f7705bff2c2004ee80e1f87438565 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import numpy as np
import math
from obstacle_detection import check_for_obs
# State machine states
FOLLOW_LANE = 0
DECELERATE_TO_STOP = 1
STAY_STOPPED = 2
# Stop speed threshold
STOP_THRESHOLD = 0.02
# Number of cycles before moving from stop sign.
SEMAPHORE = 3
STOP_COUNTS = 10
class Behav... | 45.972561 | 146 | 0.597387 |
import numpy as np
import math
from obstacle_detection import check_for_obs
FOLLOW_LANE = 0
DECELERATE_TO_STOP = 1
STAY_STOPPED = 2
STOP_THRESHOLD = 0.02
SEMAPHORE = 3
STOP_COUNTS = 10
class BehaviouralPlanner:
def __init__(self, lookahead, lead_vehicle_lookahead, traffic_light_state):
self._lookahead... | true | true |
f74c15cee34f3b028bc37ac3ca72e02625cf7231 | 1,946 | py | Python | apiflask/utils.py | johntheprime/apiflask | 66e2138662e5fde1b1b1b053f375aa67a347c12c | [
"MIT"
] | 1 | 2021-04-14T00:42:45.000Z | 2021-04-14T00:42:45.000Z | apiflask/utils.py | wo-ni/apiflask | bd7cf2c10f00426c8aff423e0d49371931b1cbfa | [
"MIT"
] | null | null | null | apiflask/utils.py | wo-ni/apiflask | bd7cf2c10f00426c8aff423e0d49371931b1cbfa | [
"MIT"
] | null | null | null | from typing import Any
from werkzeug.http import HTTP_STATUS_CODES
_sentinel = object()
# TODO Remove these shortcuts when pin Flask>=2.0
def route_shortcuts(cls):
"""A decorator used to add route shortcuts for `Flask` and `Blueprint` objects.
Includes `get()`, `post()`, `put()`, `patch()`, `delete()`.
... | 25.272727 | 83 | 0.593525 | from typing import Any
from werkzeug.http import HTTP_STATUS_CODES
_sentinel = object()
def route_shortcuts(cls):
cls_route = cls.route
def get(self, rule: str, **options: Any):
return cls_route(self, rule, methods=['GET'], **options)
def post(self, rule: str, **options: Any):
return c... | true | true |
f74c15e4ec00f6e892164283fc3c428aaa9272c1 | 2,154 | py | Python | api/migrations/0001_initial.py | funsojoba/send_me_api | 8f3c0b0002aaf6b37fd31b0d6a6de3f0402a00e3 | [
"MIT"
] | null | null | null | api/migrations/0001_initial.py | funsojoba/send_me_api | 8f3c0b0002aaf6b37fd31b0d6a6de3f0402a00e3 | [
"MIT"
] | null | null | null | api/migrations/0001_initial.py | funsojoba/send_me_api | 8f3c0b0002aaf6b37fd31b0d6a6de3f0402a00e3 | [
"MIT"
] | null | null | null | # Generated by Django 3.2.5 on 2021-07-22 21:15
import api.models.user
from django.db import migrations, models
import uuid
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0012_alter_user_first_name_max_length'),
]
operations = [
migrations.CreateMo... | 47.866667 | 266 | 0.612813 |
import api.models.user
from django.db import migrations, models
import uuid
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0012_alter_user_first_name_max_length'),
]
operations = [
migrations.CreateModel(
name='User',
fields... | true | true |
f74c168c438d5d76ce9b5746196c2b82a66b1dfc | 38,114 | py | Python | instances/passenger_demand/pas-20210421-2109-int16e/28.py | LHcau/scheduling-shared-passenger-and-freight-transport-on-a-fixed-infrastructure | bba1e6af5bc8d9deaa2dc3b83f6fe9ddf15d2a11 | [
"BSD-3-Clause"
] | null | null | null | instances/passenger_demand/pas-20210421-2109-int16e/28.py | LHcau/scheduling-shared-passenger-and-freight-transport-on-a-fixed-infrastructure | bba1e6af5bc8d9deaa2dc3b83f6fe9ddf15d2a11 | [
"BSD-3-Clause"
] | null | null | null | instances/passenger_demand/pas-20210421-2109-int16e/28.py | LHcau/scheduling-shared-passenger-and-freight-transport-on-a-fixed-infrastructure | bba1e6af5bc8d9deaa2dc3b83f6fe9ddf15d2a11 | [
"BSD-3-Clause"
] | null | null | null |
"""
PASSENGERS
"""
numPassengers = 3820
passenger_arriving = (
(3, 13, 5, 5, 1, 0, 10, 13, 5, 4, 2, 0), # 0
(4, 9, 7, 5, 2, 0, 10, 14, 8, 5, 1, 0), # 1
(2, 11, 3, 4, 2, 0, 10, 11, 9, 9, 1, 0), # 2
(7, 15, 7, 3, 4, 0, 5, 10, 12, 6, 2, 0), # 3
(5, 6, 4, 2, 2, 0, 10, 10, 6, 4, 1, 0), # 4
(8, 10, 7, 8, 3, 0, ... | 113.773134 | 214 | 0.730703 |
numPassengers = 3820
passenger_arriving = (
(3, 13, 5, 5, 1, 0, 10, 13, 5, 4, 2, 0), (4, 9, 7, 5, 2, 0, 10, 14, 8, 5, 1, 0), (2, 11, 3, 4, 2, 0, 10, 11, 9, 9, 1, 0), (7, 15, 7, 3, 4, 0, 5, 10, 12, 6, 2, 0), (5, 6, 4, 2, 2, 0, 10, 10, 6, 4, 1, 0), (8, 10, 7, 8, 3, 0, 14, 5, 11, 7, 2, 0), (3, 13, 6, 3, 1, 0, 6,... | true | true |
f74c17050aec1cd1b387e07aec1f29819f1b9735 | 329 | py | Python | Python/Exercicios/ex0063.py | Gabysx/CursoEmVideo | f5c966742c3da8f0c79a3266d1b0d0b22b5d2af5 | [
"MIT"
] | null | null | null | Python/Exercicios/ex0063.py | Gabysx/CursoEmVideo | f5c966742c3da8f0c79a3266d1b0d0b22b5d2af5 | [
"MIT"
] | null | null | null | Python/Exercicios/ex0063.py | Gabysx/CursoEmVideo | f5c966742c3da8f0c79a3266d1b0d0b22b5d2af5 | [
"MIT"
] | null | null | null | print('-'*25)
print('Sequência de Fibonacci')
print('-'*25)
termos = int(input('Quantos termos vc quer mostrar? '))
c = 1
valor = -1
valor1 = 1
valor2 = 0
print('~'*30)
while c <= termos:
valor2 = valor + valor1
valor = valor1
valor1 = valor2
print(f'{valor2}', end=' => ')
c += 1
print('FIM')
print(... | 17.315789 | 55 | 0.583587 | print('-'*25)
print('Sequência de Fibonacci')
print('-'*25)
termos = int(input('Quantos termos vc quer mostrar? '))
c = 1
valor = -1
valor1 = 1
valor2 = 0
print('~'*30)
while c <= termos:
valor2 = valor + valor1
valor = valor1
valor1 = valor2
print(f'{valor2}', end=' => ')
c += 1
print('FIM')
print(... | true | true |
f74c174c89061459dcb288eaba631a7a4f885580 | 1,900 | py | Python | mlpy/particleSwarmOptimization/structure/particle.py | QuintonWeenink/pso | f6fbb4c5889745d5747b367ecb3c9833805d9963 | [
"MIT"
] | 4 | 2018-10-17T03:50:07.000Z | 2021-12-15T14:58:41.000Z | mlpy/particleSwarmOptimization/structure/particle.py | QuintonWeenink/pso | f6fbb4c5889745d5747b367ecb3c9833805d9963 | [
"MIT"
] | 4 | 2017-11-05T12:07:43.000Z | 2018-04-21T13:53:21.000Z | mlpy/particleSwarmOptimization/structure/particle.py | QuintonWeenink/pso | f6fbb4c5889745d5747b367ecb3c9833805d9963 | [
"MIT"
] | 2 | 2019-03-28T08:33:21.000Z | 2021-05-17T13:31:17.000Z | import numpy as np
class Particle(object):
def __init__(self, bounds, weight, cognitiveConstant, socialConstant):
self.position = None # particle position
self.velocity = None # particle velocity
self.best_position = None # best position individual
self.best_error = float('inf')... | 33.333333 | 90 | 0.626316 | import numpy as np
class Particle(object):
def __init__(self, bounds, weight, cognitiveConstant, socialConstant):
self.position = None self.velocity = None
self.best_position = None self.best_error = float('inf')
self.error = None
self.num_dimensions = None
... | true | true |
f74c18a798abd8d769d79801a239446279ebfc4c | 26,716 | py | Python | supvisors/tests/test_supvisorszmq.py | julien6387/supvisors | 4e32bce566dec2cf9e9a213a3698178030eb869b | [
"Apache-2.0"
] | 66 | 2017-01-05T11:28:34.000Z | 2022-03-04T08:42:01.000Z | supvisors/tests/test_supvisorszmq.py | julien6387/supvisors | 4e32bce566dec2cf9e9a213a3698178030eb869b | [
"Apache-2.0"
] | 36 | 2016-12-30T10:46:58.000Z | 2022-01-09T22:56:10.000Z | supvisors/tests/test_supvisorszmq.py | julien6387/supvisors | 4e32bce566dec2cf9e9a213a3698178030eb869b | [
"Apache-2.0"
] | 12 | 2017-03-04T04:53:51.000Z | 2022-01-28T13:03:22.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
# ======================================================================
# Copyright 2017 Julien LE CLEACH
#
# 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 Lice... | 44.01318 | 119 | 0.734953 |
import pytest
from supvisors.supvisorszmq import *
from supvisors.utils import DeferredRequestHeaders
from time import sleep
from unittest.mock import call, Mock
def test_internal_publish_subscribe(supvisors):
publisher = InternalEventPublisher(supvisors.address_mapper.local_node_name,
... | true | true |
f74c18e220fa5c14f0dd67918842dfc42cba21fb | 1,141 | py | Python | sql_util.py | hoaipham97/togo | 4438f87efa74736291f095276bd137a6ac1ea6c2 | [
"MIT"
] | null | null | null | sql_util.py | hoaipham97/togo | 4438f87efa74736291f095276bd137a6ac1ea6c2 | [
"MIT"
] | null | null | null | sql_util.py | hoaipham97/togo | 4438f87efa74736291f095276bd137a6ac1ea6c2 | [
"MIT"
] | null | null | null | import sqlite3
from my_config import DB_CONNECTION_STR
class SqliteUtil():
def __init__(self):
self.db_connection_str = DB_CONNECTION_STR
self.con = sqlite3.connect(self.db_connection_str, check_same_thread=False)
self.con.row_factory = sqlite3.Row
self.cursorObj = self.con.cursor... | 32.6 | 84 | 0.6617 | import sqlite3
from my_config import DB_CONNECTION_STR
class SqliteUtil():
def __init__(self):
self.db_connection_str = DB_CONNECTION_STR
self.con = sqlite3.connect(self.db_connection_str, check_same_thread=False)
self.con.row_factory = sqlite3.Row
self.cursorObj = self.con.cursor... | true | true |
f74c19404ae00df57fd8a4b37a404ddf245b1061 | 488 | py | Python | Native_Service/migrations/0005_secret_key_added.py | sylwekb/native_service_API | 5fe74081923a5f8301592fb62505f917635d8c7a | [
"MIT"
] | null | null | null | Native_Service/migrations/0005_secret_key_added.py | sylwekb/native_service_API | 5fe74081923a5f8301592fb62505f917635d8c7a | [
"MIT"
] | null | null | null | Native_Service/migrations/0005_secret_key_added.py | sylwekb/native_service_API | 5fe74081923a5f8301592fb62505f917635d8c7a | [
"MIT"
] | null | null | null | # Generated by Django 2.2.1 on 2019-06-07 11:12
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [("Native_Service", "0004_date_time_field_changed")]
operations = [
migrations.AddField(
model_name="nativepost",
... | 25.684211 | 85 | 0.663934 |
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [("Native_Service", "0004_date_time_field_changed")]
operations = [
migrations.AddField(
model_name="nativepost",
name="secret_key",
field=... | true | true |
f74c195ba58a81f64bb87c397a355bfeccf0bf79 | 1,893 | py | Python | src/app/client/host.py | acatalfano/distributed-systems-assignment-1 | 442510f14f2ae167b95a18bb458c2cf64f5caa87 | [
"MIT"
] | null | null | null | src/app/client/host.py | acatalfano/distributed-systems-assignment-1 | 442510f14f2ae167b95a18bb458c2cf64f5caa87 | [
"MIT"
] | null | null | null | src/app/client/host.py | acatalfano/distributed-systems-assignment-1 | 442510f14f2ae167b95a18bb458c2cf64f5caa87 | [
"MIT"
] | null | null | null | from typing import Callable
from .subscriber.subscriber import Subscriber
from .publisher.publisher import Publisher
from ..common.broker_mode import BrokerMode, BROKER_MODE
from .subscriber.subscriber_factory import SubscriberFactory
from .publisher.publisher_factory import PublisherFactory
'''
A host can be both a ... | 36.403846 | 89 | 0.704173 | from typing import Callable
from .subscriber.subscriber import Subscriber
from .publisher.publisher import Publisher
from ..common.broker_mode import BrokerMode, BROKER_MODE
from .subscriber.subscriber_factory import SubscriberFactory
from .publisher.publisher_factory import PublisherFactory
class Host:
def __i... | true | true |
f74c1a3c72eee3762e9dc4a668d7f5a3311ff7e2 | 258 | py | Python | yepes/contrib/metrics/settings.py | samuelmaudo/yepes | 1ef9a42d4eaa70d9b3e6e7fa519396c1e1174fcb | [
"BSD-3-Clause"
] | null | null | null | yepes/contrib/metrics/settings.py | samuelmaudo/yepes | 1ef9a42d4eaa70d9b3e6e7fa519396c1e1174fcb | [
"BSD-3-Clause"
] | null | null | null | yepes/contrib/metrics/settings.py | samuelmaudo/yepes | 1ef9a42d4eaa70d9b3e6e7fa519396c1e1174fcb | [
"BSD-3-Clause"
] | null | null | null | # -*- coding:utf-8 -*-
from __future__ import unicode_literals
METRICS_COOKIE_AGE = 60 * 60 * 24 * 30 * 6
METRICS_COOKIE_DOMAIN = None
METRICS_COOKIE_HTTPONLY = True
METRICS_COOKIE_NAME = 'visitorid'
METRICS_COOKIE_PATH = '/'
METRICS_COOKIE_SECURE = False
| 23.454545 | 42 | 0.767442 |
from __future__ import unicode_literals
METRICS_COOKIE_AGE = 60 * 60 * 24 * 30 * 6
METRICS_COOKIE_DOMAIN = None
METRICS_COOKIE_HTTPONLY = True
METRICS_COOKIE_NAME = 'visitorid'
METRICS_COOKIE_PATH = '/'
METRICS_COOKIE_SECURE = False
| true | true |
f74c1a66977877e6f1cb8612a708d5fa107eb08c | 7,588 | py | Python | examples/core/models/mzi_cnn.py | JeremieMelo/pytorch-onn | 670996112277a6c19c7da400afbe0a4ce45ad5de | [
"MIT"
] | 16 | 2021-06-09T07:51:43.000Z | 2022-03-24T08:16:52.000Z | examples/core/models/mzi_cnn.py | JeremieMelo/pytorch-onn | 670996112277a6c19c7da400afbe0a4ce45ad5de | [
"MIT"
] | null | null | null | examples/core/models/mzi_cnn.py | JeremieMelo/pytorch-onn | 670996112277a6c19c7da400afbe0a4ce45ad5de | [
"MIT"
] | 3 | 2021-07-20T15:16:49.000Z | 2022-03-24T08:16:56.000Z | """
Description:
Author: Jiaqi Gu (jqgu@utexas.edu)
Date: 2021-06-07 03:43:40
LastEditors: Jiaqi Gu (jqgu@utexas.edu)
LastEditTime: 2021-06-07 03:43:40
"""
from torchonn.op.mzi_op import project_matrix_to_unitary
from typing import List, Union
import torch
from torch import Tensor, nn
from torch.types import Device, ... | 32.016878 | 134 | 0.580917 |
from torchonn.op.mzi_op import project_matrix_to_unitary
from typing import List, Union
import torch
from torch import Tensor, nn
from torch.types import Device, _size
from torchonn.layers import MZIBlockConv2d, MZIBlockLinear
from torchonn.models import ONNBaseModel
from collections import OrderedDict
__all__ = ["M... | true | true |
f74c1b5eccc20aac0fdd0a9ea8deaf23aa0fb6fd | 4,819 | py | Python | demo/demo.py | 888yzbt888/Pensieve-multiagent | b5409c949a4855afedc910de5dd6eabe076567cc | [
"MIT"
] | 2 | 2018-06-20T07:23:15.000Z | 2019-05-17T08:13:57.000Z | demo/demo.py | 888yzbt888/Pensieve-multiagent | b5409c949a4855afedc910de5dd6eabe076567cc | [
"MIT"
] | null | null | null | demo/demo.py | 888yzbt888/Pensieve-multiagent | b5409c949a4855afedc910de5dd6eabe076567cc | [
"MIT"
] | null | null | null | import time
import bisect
import cv2 as cv
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.animation as animation
from matplotlib import gridspec
VIDEO_FILE = 'la_luna.mp4'
RL_BITRATE_FILE = './rl_bitrate'
RL_BUFFER_FILE = './rl_buffer'
MPC_BITRATE_FILE = './mpc_bitrate'
MPC_BUFFER_FILE = './mpc_... | 30.308176 | 102 | 0.709276 | import time
import bisect
import cv2 as cv
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.animation as animation
from matplotlib import gridspec
VIDEO_FILE = 'la_luna.mp4'
RL_BITRATE_FILE = './rl_bitrate'
RL_BUFFER_FILE = './rl_buffer'
MPC_BITRATE_FILE = './mpc_bitrate'
MPC_BUFFER_FILE = './mpc_... | true | true |
f74c1b9695c1bcb5d504001f599ba92ef0073b7d | 8,513 | py | Python | tests/test_dataset.py | caoyi0905/Surprise | 1a707b32a3a68b0eb3f23b829b57604a131e00f7 | [
"BSD-3-Clause"
] | 1 | 2019-03-15T15:19:42.000Z | 2019-03-15T15:19:42.000Z | tests/test_dataset.py | caoyi0905/Surprise | 1a707b32a3a68b0eb3f23b829b57604a131e00f7 | [
"BSD-3-Clause"
] | null | null | null | tests/test_dataset.py | caoyi0905/Surprise | 1a707b32a3a68b0eb3f23b829b57604a131e00f7 | [
"BSD-3-Clause"
] | 1 | 2019-10-06T14:29:39.000Z | 2019-10-06T14:29:39.000Z | """
Module for testing the Dataset class.
"""
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import os
import random
import pytest
import pandas as pd
from surprise import BaselineOnly
from surprise import Dataset
from surprise import Reader
from surprise... | 34.465587 | 79 | 0.636908 |
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import os
import random
import pytest
import pandas as pd
from surprise import BaselineOnly
from surprise import Dataset
from surprise import Reader
from surprise.builtin_datasets import get_dataset_dir
ran... | true | true |
f74c1cdcabadfef63181f8c7c72575317960a3d8 | 2,697 | py | Python | src/test_sort.py | lionbee/photosort | b2c51b3fd010f217c817dd344f31522cceec2326 | [
"MIT"
] | 1 | 2020-01-19T08:07:58.000Z | 2020-01-19T08:07:58.000Z | src/test_sort.py | lionbee/photosort | b2c51b3fd010f217c817dd344f31522cceec2326 | [
"MIT"
] | null | null | null | src/test_sort.py | lionbee/photosort | b2c51b3fd010f217c817dd344f31522cceec2326 | [
"MIT"
] | null | null | null | import unittest
from datetime import datetime
from os import path
from unittest.mock import patch, MagicMock
import sort
class TestPathStrMaker(unittest.TestCase):
def test_maker_is_callable(self):
fn = sort.get_path_str_maker('tester')
self.assertTrue(callable(fn))
@patch('sort._get_exif_d... | 32.890244 | 77 | 0.674082 | import unittest
from datetime import datetime
from os import path
from unittest.mock import patch, MagicMock
import sort
class TestPathStrMaker(unittest.TestCase):
def test_maker_is_callable(self):
fn = sort.get_path_str_maker('tester')
self.assertTrue(callable(fn))
@patch('sort._get_exif_d... | true | true |
f74c1d0a3c020ac4d664d8c04f597c06d0ff607b | 2,604 | py | Python | 2015/2015_14b.py | davidxiao93/Advent-of-Code | 29503100ae4eb46b048fc3ab68ff0181c6f00ee5 | [
"MIT"
] | null | null | null | 2015/2015_14b.py | davidxiao93/Advent-of-Code | 29503100ae4eb46b048fc3ab68ff0181c6f00ee5 | [
"MIT"
] | null | null | null | 2015/2015_14b.py | davidxiao93/Advent-of-Code | 29503100ae4eb46b048fc3ab68ff0181c6f00ee5 | [
"MIT"
] | null | null | null | input = """Vixen can fly 19 km/s for 7 seconds, but then must rest for 124 seconds.
Rudolph can fly 3 km/s for 15 seconds, but then must rest for 28 seconds.
Donner can fly 19 km/s for 9 seconds, but then must rest for 164 seconds.
Blitzen can fly 19 km/s for 9 seconds, but then must rest for 158 seconds.
Comet can fly... | 34.72 | 86 | 0.617512 | input = """Vixen can fly 19 km/s for 7 seconds, but then must rest for 124 seconds.
Rudolph can fly 3 km/s for 15 seconds, but then must rest for 28 seconds.
Donner can fly 19 km/s for 9 seconds, but then must rest for 164 seconds.
Blitzen can fly 19 km/s for 9 seconds, but then must rest for 158 seconds.
Comet can fly... | true | true |
f74c1d10cb1d7e731069d1756e841de393dbca88 | 2,925 | py | Python | AutomatedTesting/Gem/PythonTests/physics/general/C15425929_Undo_Redo.py | fromasmtodisasm/o3de | 0d728a76778cb0ca88caa5c07f17162fac668b2a | [
"Apache-2.0",
"MIT"
] | null | null | null | AutomatedTesting/Gem/PythonTests/physics/general/C15425929_Undo_Redo.py | fromasmtodisasm/o3de | 0d728a76778cb0ca88caa5c07f17162fac668b2a | [
"Apache-2.0",
"MIT"
] | null | null | null | AutomatedTesting/Gem/PythonTests/physics/general/C15425929_Undo_Redo.py | fromasmtodisasm/o3de | 0d728a76778cb0ca88caa5c07f17162fac668b2a | [
"Apache-2.0",
"MIT"
] | null | null | null | """
Copyright (c) Contributors to the Open 3D Engine Project.
For complete copyright and license terms please see the LICENSE at the root of this distribution.
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
# Test case ID : C15425929
# Test Case Title : Verify that undo - redo operations do not create any error
# ... | 32.142857 | 101 | 0.681368 |
class Tests:
entity_found = ("Entity was initially found", "Entity COULD NOT be found initially")
entity_deleted = ("Entity was deleted", "Entity WAS NOT deleted")
deletion_undone = ("Undo worked", "Undo DID NOT work")
deletion_redone = ("Re... | true | true |
f74c1d9f90741e6338b1fcb8584bd00486b71cb7 | 1,718 | py | Python | built-in/PyTorch/Official/cv/image_object_detection/YoloV3_ID1790_for_PyTorch/tools/publish_model.py | Ascend/modelzoo | f018cfed33dbb1cc2110b9ea2e233333f71cc509 | [
"Apache-2.0"
] | 12 | 2020-12-13T08:34:24.000Z | 2022-03-20T15:17:17.000Z | built-in/PyTorch/Official/cv/image_object_detection/YoloV3_ID1790_for_PyTorch/tools/publish_model.py | Ascend/modelzoo | f018cfed33dbb1cc2110b9ea2e233333f71cc509 | [
"Apache-2.0"
] | 1 | 2022-01-20T03:11:05.000Z | 2022-01-20T06:53:39.000Z | built-in/PyTorch/Official/cv/image_object_detection/YoloV3_ID1790_for_PyTorch/tools/publish_model.py | Ascend/modelzoo | f018cfed33dbb1cc2110b9ea2e233333f71cc509 | [
"Apache-2.0"
] | 2 | 2021-07-10T12:40:46.000Z | 2021-12-17T07:55:15.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 agree... | 31.814815 | 77 | 0.715949 |
import argparse
import subprocess
import torch
def parse_args():
parser = argparse.ArgumentParser(
description='Process a checkpoint to be published')
parser.add_argument('in_file', help='input checkpoint filename')
parser.add_argument('out_file', help='output checkpoint filename')
args = pa... | true | true |
f74c1ec9191d3a035f8f599e0d5ea531c2aa27e2 | 375 | py | Python | src/pyagxrobots/test.py | agilexrobotics/pyagxrobots | fcc66ac2da6c2d4e03fe6fbee2b963f4a5758aa2 | [
"MIT"
] | 3 | 2021-11-15T07:02:04.000Z | 2022-01-12T17:17:45.000Z | src/pyagxrobots/test.py | agilexrobotics/pyagxrobots | fcc66ac2da6c2d4e03fe6fbee2b963f4a5758aa2 | [
"MIT"
] | 1 | 2022-03-01T21:45:42.000Z | 2022-03-01T21:45:42.000Z | src/pyagxrobots/test.py | agilexrobotics/pyagxrobots | fcc66ac2da6c2d4e03fe6fbee2b963f4a5758aa2 | [
"MIT"
] | 2 | 2021-12-15T03:27:08.000Z | 2022-01-07T12:13:50.000Z | #!/usr/bin/env python3
# coding=UTF-8
import pyagxrobots
import time
scoutmini=pyagxrobots.pysdkugv.ScoutMiniBase()
scoutmini.EnableCAN()
num=5
while num>0:
scoutmini.SetMotionCommand(linear_vel=0.1)
print('rpm')
print(scoutmini.ScoutMiniActuator2.rpm())
print('GetLinearVelocity')
print(scoutmi... | 22.058824 | 46 | 0.728 | import pyagxrobots
import time
scoutmini=pyagxrobots.pysdkugv.ScoutMiniBase()
scoutmini.EnableCAN()
num=5
while num>0:
scoutmini.SetMotionCommand(linear_vel=0.1)
print('rpm')
print(scoutmini.ScoutMiniActuator2.rpm())
print('GetLinearVelocity')
print(scoutmini.GetLinearVelocity())
time.sleep... | true | true |
f74c204542d4211b7d872aaea26a6bd2119f6877 | 2,933 | py | Python | wastd/observations/migrations/0034_auto_20210224_1538.py | florianm/wastd | e26bdd66fd082ae1ffbe7b72bc9e3b216fc24523 | [
"MIT"
] | 3 | 2020-07-23T06:37:43.000Z | 2022-01-27T09:40:40.000Z | wastd/observations/migrations/0034_auto_20210224_1538.py | dbca-wa/wastd | faf369bc8f053a03f21240332284b2f4fed2b85e | [
"MIT"
] | 337 | 2018-07-12T05:56:29.000Z | 2022-03-30T02:40:41.000Z | wastd/observations/migrations/0034_auto_20210224_1538.py | florianm/wastd | e26bdd66fd082ae1ffbe7b72bc9e3b216fc24523 | [
"MIT"
] | 2 | 2020-02-24T00:05:46.000Z | 2020-07-15T07:02:29.000Z | # Generated by Django 3.0.8 on 2021-02-24 07:38
from django.db import migrations, models
import django.db.models.deletion
import uuid
import wastd.observations.models
class Migration(migrations.Migration):
dependencies = [
('observations', '0033_auto_20210219_1350'),
]
operations = [
mi... | 51.45614 | 244 | 0.667235 |
from django.db import migrations, models
import django.db.models.deletion
import uuid
import wastd.observations.models
class Migration(migrations.Migration):
dependencies = [
('observations', '0033_auto_20210219_1350'),
]
operations = [
migrations.AddField(
model_name='surve... | true | true |
f74c208e01bfe49c49688ef24b97783f14d33b77 | 1,097 | py | Python | wolframclient/tests/externalevaluate/ev_loop.py | LaudateCorpus1/WolframClientForPython | 26f7fa3d81691ba2a63d3eadcd9734b261130b7c | [
"MIT"
] | 1 | 2021-07-15T22:52:40.000Z | 2021-07-15T22:52:40.000Z | wolframclient/tests/externalevaluate/ev_loop.py | LaudateCorpus1/WolframClientForPython | 26f7fa3d81691ba2a63d3eadcd9734b261130b7c | [
"MIT"
] | 1 | 2021-07-15T22:50:23.000Z | 2021-07-15T22:50:23.000Z | wolframclient/tests/externalevaluate/ev_loop.py | LaudateCorpus1/WolframClientForPython | 26f7fa3d81691ba2a63d3eadcd9734b261130b7c | [
"MIT"
] | null | null | null | from __future__ import absolute_import, print_function, unicode_literals
from threading import Thread
import zmq
from wolframclient.language import wl
from wolframclient.serializers import export
from wolframclient.utils.externalevaluate import EXPORT_KWARGS, start_zmq_loop
from wolframclient.utils.tests import Test... | 28.868421 | 78 | 0.694622 | from __future__ import absolute_import, print_function, unicode_literals
from threading import Thread
import zmq
from wolframclient.language import wl
from wolframclient.serializers import export
from wolframclient.utils.externalevaluate import EXPORT_KWARGS, start_zmq_loop
from wolframclient.utils.tests import Test... | true | true |
f74c20f4809a7cac07350b6f2b4b090403a57f55 | 493 | py | Python | taghaza/migrations/0016_auto_20190811_1117.py | mablue/Specialized-Procurement-and-Sales-Management-System-for-East-Azarbaijan-Gas-Company | da071bd199a92d571228a1d823a7fa1f52275604 | [
"MIT"
] | 30 | 2019-08-18T14:57:39.000Z | 2022-03-15T22:09:09.000Z | taghaza/migrations/0016_auto_20190811_1117.py | mablue/Specialized-Procurement-and-Sales-Management-System-for-East-Azarbaijan-Gas-Company | da071bd199a92d571228a1d823a7fa1f52275604 | [
"MIT"
] | 3 | 2021-03-19T00:46:32.000Z | 2021-09-22T01:29:08.000Z | taghaza/migrations/0016_auto_20190811_1117.py | mablue/Specialized-Procurement-and-Sales-Management-System-for-East-Azarbaijan-Gas-Company | da071bd199a92d571228a1d823a7fa1f52275604 | [
"MIT"
] | 7 | 2019-08-20T14:04:28.000Z | 2021-06-29T06:43:08.000Z | # Generated by Django 2.2.4 on 2019-08-11 11:17
from django.db import migrations, models
import taghaza.models
class Migration(migrations.Migration):
dependencies = [
('taghaza', '0015_auto_20190811_1052'),
]
operations = [
migrations.AlterField(
model_name='taghaza',
... | 24.65 | 135 | 0.651116 |
from django.db import migrations, models
import taghaza.models
class Migration(migrations.Migration):
dependencies = [
('taghaza', '0015_auto_20190811_1052'),
]
operations = [
migrations.AlterField(
model_name='taghaza',
name='image',
field=models.Ima... | true | true |
f74c2111c17c805b2f928edb1a0faf49e7ed58c6 | 55,207 | py | Python | pywbemtools/pywbemcli/_common.py | 3v1lW1th1n/pywbemtools | ed4caea84dff5daa7c9a2c10dc493857c7118a29 | [
"Apache-2.0"
] | null | null | null | pywbemtools/pywbemcli/_common.py | 3v1lW1th1n/pywbemtools | ed4caea84dff5daa7c9a2c10dc493857c7118a29 | [
"Apache-2.0"
] | null | null | null | pywbemtools/pywbemcli/_common.py | 3v1lW1th1n/pywbemtools | ed4caea84dff5daa7c9a2c10dc493857c7118a29 | [
"Apache-2.0"
] | null | null | null | # (C) Copyright 2017 IBM Corp.
# (C) Copyright 2017 Inova Development Inc.
# 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-... | 35.096631 | 119 | 0.619831 |
from __future__ import absolute_import, print_function, unicode_literals
import fnmatch
import re
from textwrap import fill
from operator import itemgetter
import six
import click
import tabulate
from pywbem import CIMInstanceName, CIMInstance, CIMClass, \
CIMQualifierDeclaration, CIMProperty, CIMClassName, \
... | true | true |
f74c21d488310346ed2cc7d7fc7b155844081743 | 223 | py | Python | igftools.py | imperial-genomics-facility/Metadata_validation | d6e1cd51c32768bf578101688ad02db65684a568 | [
"Apache-2.0"
] | null | null | null | igftools.py | imperial-genomics-facility/Metadata_validation | d6e1cd51c32768bf578101688ad02db65684a568 | [
"Apache-2.0"
] | 3 | 2020-03-24T18:04:16.000Z | 2021-02-02T22:25:57.000Z | igftools.py | imperial-genomics-facility/Metadata_validation | d6e1cd51c32768bf578101688ad02db65684a568 | [
"Apache-2.0"
] | null | null | null | import os
from flask_migrate import Migrate, upgrade
from app import create_app, db
flask_config_name = os.environ.get('FLASK_CONFIG') or 'testing'
app = create_app(config_name=flask_config_name)
migrate = Migrate(app, db) | 31.857143 | 63 | 0.807175 | import os
from flask_migrate import Migrate, upgrade
from app import create_app, db
flask_config_name = os.environ.get('FLASK_CONFIG') or 'testing'
app = create_app(config_name=flask_config_name)
migrate = Migrate(app, db) | true | true |
f74c23bc2ce110519025b9152a27d7ba0a18bdb6 | 2,896 | py | Python | xenadapter/__init__.py | pashazz/vmemperor | a0b53f67d75cccbd8e1e6a0419d85babab7041f5 | [
"Apache-2.0"
] | 1 | 2019-02-02T15:01:32.000Z | 2019-02-02T15:01:32.000Z | xenadapter/__init__.py | pashazz/vmemperor | a0b53f67d75cccbd8e1e6a0419d85babab7041f5 | [
"Apache-2.0"
] | null | null | null | xenadapter/__init__.py | pashazz/vmemperor | a0b53f67d75cccbd8e1e6a0419d85babab7041f5 | [
"Apache-2.0"
] | null | null | null | import XenAPI
from loggable import Loggable
from .singleton import Singleton
from exc import *
import threading
from rethinkdb import RethinkDB
r = RethinkDB()
class XenAdapter(Loggable, metaclass=Singleton):
AUTOINSTALL_PREFIX = '/autoinstall'
VMEMPEROR_ACCESS_PREFIX='vm-data/vmemperor/access'
def __... | 34.47619 | 142 | 0.610152 | import XenAPI
from loggable import Loggable
from .singleton import Singleton
from exc import *
import threading
from rethinkdb import RethinkDB
r = RethinkDB()
class XenAdapter(Loggable, metaclass=Singleton):
AUTOINSTALL_PREFIX = '/autoinstall'
VMEMPEROR_ACCESS_PREFIX='vm-data/vmemperor/access'
def __... | true | true |
f74c23e1f8f09a0e955ca7e10b54304fe7798f67 | 8,535 | py | Python | docs/conf.py | ryananguiano/aioredis-timeseries | 97ae0709df97df90fad76ffa9dd0c0fef3f8f92e | [
"MIT"
] | 1 | 2021-03-03T18:47:56.000Z | 2021-03-03T18:47:56.000Z | docs/conf.py | ryananguiano/aioredis-timeseries | 97ae0709df97df90fad76ffa9dd0c0fef3f8f92e | [
"MIT"
] | null | null | null | docs/conf.py | ryananguiano/aioredis-timeseries | 97ae0709df97df90fad76ffa9dd0c0fef3f8f92e | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# aioredis_timeseries documentation build configuration file, created by
# sphinx-quickstart on Tue Jul 9 22:26:36 2013.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present i... | 30.923913 | 76 | 0.719508 |
import sys
import os
cwd = os.getcwd()
project_root = os.path.dirname(cwd)
sys.path.insert(0, project_root)
import aioredis_timeseries
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.viewcode']
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'index'
project = u'Redis Timeseries'
copyrig... | true | true |
f74c253065d06ec16bb4f9d8fc4223fc0e3c69b7 | 3,615 | py | Python | tests/queue_test.py | jfw225/ptlib | a78ef707ed09aa9c1f1b1157a20e3d9d3fb04c4d | [
"MIT"
] | 1 | 2022-01-06T07:04:43.000Z | 2022-01-06T07:04:43.000Z | tests/queue_test.py | jfw225/ptlib | a78ef707ed09aa9c1f1b1157a20e3d9d3fb04c4d | [
"MIT"
] | null | null | null | tests/queue_test.py | jfw225/ptlib | a78ef707ed09aa9c1f1b1157a20e3d9d3fb04c4d | [
"MIT"
] | null | null | null | import cv2
import pickle
import numpy as np
import ptlib as pt
from ptlib.core.metadata import MetadataManager
from ptlib.core.queue import Queue
class VideoIngest(pt.Task):
# variables here are static
NUM_WORKERS = 1
VIDEO_PATH = "C:\\Users\\Owner\\Videos\\Battlefield 2042 Open Beta\\testvid.mp4"
B... | 28.690476 | 105 | 0.637068 | import cv2
import pickle
import numpy as np
import ptlib as pt
from ptlib.core.metadata import MetadataManager
from ptlib.core.queue import Queue
class VideoIngest(pt.Task):
NUM_WORKERS = 1
VIDEO_PATH = "C:\\Users\\Owner\\Videos\\Battlefield 2042 Open Beta\\testvid.mp4"
BATCH_SIZE = 30 * 5
def... | true | true |
f74c2644c0482d28c1f2401d1ed10de194171950 | 80 | py | Python | mezzanine/utils/__init__.py | kevinlai219/Mezzanine-Django | a92cde236448e19cdbf853b5cb34f99a60972147 | [
"BSD-2-Clause"
] | 3,053 | 2015-01-01T08:16:01.000Z | 2022-03-31T12:06:03.000Z | mezzanine/utils/__init__.py | kevinlai219/Mezzanine-Django | a92cde236448e19cdbf853b5cb34f99a60972147 | [
"BSD-2-Clause"
] | 818 | 2015-01-03T05:44:45.000Z | 2022-03-08T00:06:23.000Z | mezzanine/utils/__init__.py | kevinlai219/Mezzanine-Django | a92cde236448e19cdbf853b5cb34f99a60972147 | [
"BSD-2-Clause"
] | 1,352 | 2015-01-01T06:17:14.000Z | 2022-03-26T16:21:54.000Z | """
Various utility functions used throughout the different Mezzanine apps.
"""
| 20 | 71 | 0.775 | true | true | |
f74c268c185b718a95e5a283e39a97dbabf9461d | 3,749 | py | Python | api/extenal/sripe.py | ferrumie/multi-pay | 3e6a6fc63de823c10b5c52ade73b8357ed8bfd48 | [
"MIT"
] | null | null | null | api/extenal/sripe.py | ferrumie/multi-pay | 3e6a6fc63de823c10b5c52ade73b8357ed8bfd48 | [
"MIT"
] | null | null | null | api/extenal/sripe.py | ferrumie/multi-pay | 3e6a6fc63de823c10b5c52ade73b8357ed8bfd48 | [
"MIT"
] | null | null | null | import os
from api.exceptions import StripeException
from api.payment import PaymentInterface
from api.request import Request
from transaction.models import Transaction
import stripe
class StripePayment(Request, PaymentInterface):
'''
Stripe payment method class
'''
def __init__(self):
url = ... | 35.037383 | 75 | 0.512937 | import os
from api.exceptions import StripeException
from api.payment import PaymentInterface
from api.request import Request
from transaction.models import Transaction
import stripe
class StripePayment(Request, PaymentInterface):
def __init__(self):
url = os.getenv("STRIPE_API_URL")
super(Stripe... | true | true |
f74c27a5c71f88c1554a22b950c0e8706ae0e1d8 | 1,314 | py | Python | apps/corecode/forms.py | bigyanlamsal/school-management-system | bced2b58576a3a393bb0de2f8d3196d8a4bf72d3 | [
"MIT"
] | null | null | null | apps/corecode/forms.py | bigyanlamsal/school-management-system | bced2b58576a3a393bb0de2f8d3196d8a4bf72d3 | [
"MIT"
] | null | null | null | apps/corecode/forms.py | bigyanlamsal/school-management-system | bced2b58576a3a393bb0de2f8d3196d8a4bf72d3 | [
"MIT"
] | null | null | null | from django import forms
from django.forms import ModelForm, modelformset_factory
from .models import (
AcademicSession,
AcademicTerm,
SiteConfig,
StudentClass,
Subject,
)
SiteConfigForm = modelformset_factory(
SiteConfig,
fields=(
"key",
"value",
),
extra=0,
)
... | 20.857143 | 103 | 0.640791 | from django import forms
from django.forms import ModelForm, modelformset_factory
from .models import (
AcademicSession,
AcademicTerm,
SiteConfig,
StudentClass,
Subject,
)
SiteConfigForm = modelformset_factory(
SiteConfig,
fields=(
"key",
"value",
),
extra=0,
)
... | true | true |
f74c2af58bc3f6a523b5b6b6ef8c1d8974dd4585 | 627 | py | Python | meiduo_mall/apps/meiduo_admin/views/group.py | Wang-TaoTao/meiduo_project | f95f097c2a85f500d0fd264a58e2f0d92771fff6 | [
"MIT"
] | null | null | null | meiduo_mall/apps/meiduo_admin/views/group.py | Wang-TaoTao/meiduo_project | f95f097c2a85f500d0fd264a58e2f0d92771fff6 | [
"MIT"
] | null | null | null | meiduo_mall/apps/meiduo_admin/views/group.py | Wang-TaoTao/meiduo_project | f95f097c2a85f500d0fd264a58e2f0d92771fff6 | [
"MIT"
] | null | null | null |
from django.contrib.auth.models import Group, Permission
from rest_framework.generics import ListAPIView
from rest_framework.viewsets import ModelViewSet
from apps.meiduo_admin.serializers.group import GroupSerialzier, GroupSimpleSerializer
from apps.meiduo_admin.utils import CustomPageNumberPagination
# 新增用户组数据-... | 21.62069 | 86 | 0.816587 |
from django.contrib.auth.models import Group, Permission
from rest_framework.generics import ListAPIView
from rest_framework.viewsets import ModelViewSet
from apps.meiduo_admin.serializers.group import GroupSerialzier, GroupSimpleSerializer
from apps.meiduo_admin.utils import CustomPageNumberPagination
class Grou... | true | true |
f74c2b01787343ceabcd266c573e8a5ae0ca981f | 19,545 | py | Python | docs/screenshots/take_all.py | body20002/qtile | e0f1968a96e9acf2b6c9562fae44802ffc9951ec | [
"MIT"
] | 2 | 2015-01-03T02:25:19.000Z | 2015-02-07T19:16:06.000Z | docs/screenshots/take_all.py | body20002/qtile | e0f1968a96e9acf2b6c9562fae44802ffc9951ec | [
"MIT"
] | 1 | 2020-04-15T20:20:42.000Z | 2020-04-15T20:20:42.000Z | docs/screenshots/take_all.py | body20002/qtile | e0f1968a96e9acf2b6c9562fae44802ffc9951ec | [
"MIT"
] | 1 | 2022-03-01T21:23:12.000Z | 2022-03-01T21:23:12.000Z | #!/usr/bin/env python3
import logging
import os
import sys
import time
import traceback
from collections import namedtuple
from pathlib import Path
from screenshots import Client, Screenshooter
def env(name, default):
return os.environ.get(name, default)
Spec = namedtuple(
"Spec",
"commands before aft... | 37.804642 | 140 | 0.536966 |
import logging
import os
import sys
import time
import traceback
from collections import namedtuple
from pathlib import Path
from screenshots import Client, Screenshooter
def env(name, default):
return os.environ.get(name, default)
Spec = namedtuple(
"Spec",
"commands before after geometry delay windo... | true | true |
f74c2b670f678ec4cd128ff7e57ac150303603cc | 6,018 | py | Python | contrib/tools/python/src/Tools/scripts/objgraph.py | HeyLey/catboost | f472aed90604ebe727537d9d4a37147985e10ec2 | [
"Apache-2.0"
] | 6,989 | 2017-07-18T06:23:18.000Z | 2022-03-31T15:58:36.000Z | python/src/Tools/scripts/objgraph.py | weiqiangzheng/sl4a | d3c17dca978cbeee545e12ea240a9dbf2a6999e9 | [
"Apache-2.0"
] | 1,978 | 2017-07-18T09:17:58.000Z | 2022-03-31T14:28:43.000Z | python/src/Tools/scripts/objgraph.py | weiqiangzheng/sl4a | d3c17dca978cbeee545e12ea240a9dbf2a6999e9 | [
"Apache-2.0"
] | 1,228 | 2017-07-18T09:03:13.000Z | 2022-03-29T05:57:40.000Z | #! /usr/bin/env python
# objgraph
#
# Read "nm -o" input (on IRIX: "nm -Bo") of a set of libraries or modules
# and print various interesting listings, such as:
#
# - which names are used but not defined in the set (and used where),
# - which names are defined in the set (and where),
# - which modules use which other ... | 27.861111 | 73 | 0.551346 |
import sys
import os
import getopt
import re
definitions = 'TRGDSBAEC'
externals = 'UV'
ignore = 'Nntrgdsbavuc'
matcher = re.compile('(.*):\t?........ (.) (.*)$')
def store(dict, key, item):
if dict.has_key(key):
dict[key].append(item)
else:
dict[key] = [item]
def flat(list):
s = ''
... | false | true |
f74c2bc275beabf186b41d75eab5ae9e1dd58aa5 | 507 | py | Python | env/lib/python3.8/site-packages/plotly/validators/histogram2dcontour/colorbar/_len.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 76 | 2020-07-06T14:44:05.000Z | 2022-02-14T15:30:21.000Z | env/lib/python3.8/site-packages/plotly/validators/histogram2dcontour/colorbar/_len.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 11 | 2020-08-09T02:30:14.000Z | 2022-03-12T00:50:14.000Z | env/lib/python3.8/site-packages/plotly/validators/histogram2dcontour/colorbar/_len.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 11 | 2020-07-12T16:18:07.000Z | 2022-02-05T16:48:35.000Z | import _plotly_utils.basevalidators
class LenValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(
self, plotly_name="len", parent_name="histogram2dcontour.colorbar", **kwargs
):
super(LenValidator, self).__init__(
plotly_name=plotly_name,
parent_name=p... | 31.6875 | 84 | 0.625247 | import _plotly_utils.basevalidators
class LenValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(
self, plotly_name="len", parent_name="histogram2dcontour.colorbar", **kwargs
):
super(LenValidator, self).__init__(
plotly_name=plotly_name,
parent_name=p... | true | true |
f74c2c998ea6eacf997a1a574edef79e92993069 | 1,345 | py | Python | third_party/modeltranslation/forms.py | asysc2020/contentbox | 5c155976e0ce7ea308d62293ab89624d97b21d09 | [
"Apache-2.0"
] | 39 | 2015-06-10T23:18:07.000Z | 2021-10-21T04:29:06.000Z | third_party/modeltranslation/forms.py | asysc2020/contentbox | 5c155976e0ce7ea308d62293ab89624d97b21d09 | [
"Apache-2.0"
] | 2 | 2016-08-22T12:38:10.000Z | 2017-01-26T18:37:33.000Z | third_party/modeltranslation/forms.py | asysc2020/contentbox | 5c155976e0ce7ea308d62293ab89624d97b21d09 | [
"Apache-2.0"
] | 26 | 2015-06-10T22:09:15.000Z | 2021-06-27T15:45:15.000Z | # -*- coding: utf-8 -*-
from django import forms
from django.core import validators
from modeltranslation.fields import TranslationField
class TranslationModelForm(forms.ModelForm):
def __init__(self, *args, **kwargs):
super(TranslationModelForm, self).__init__(*args, **kwargs)
for f in self._met... | 32.804878 | 92 | 0.666914 | from django import forms
from django.core import validators
from modeltranslation.fields import TranslationField
class TranslationModelForm(forms.ModelForm):
def __init__(self, *args, **kwargs):
super(TranslationModelForm, self).__init__(*args, **kwargs)
for f in self._meta.model._meta.fields:
... | true | true |
f74c2d0f21099ebafccbb9ea3a807b49ec3c504b | 1,479 | py | Python | recetas/migrations/0015_auto_20170912_1242.py | WFPColombia/nutrifami-recipes | b976efc366cb9f66108f3365a60b968eedfc1614 | [
"MIT"
] | null | null | null | recetas/migrations/0015_auto_20170912_1242.py | WFPColombia/nutrifami-recipes | b976efc366cb9f66108f3365a60b968eedfc1614 | [
"MIT"
] | null | null | null | recetas/migrations/0015_auto_20170912_1242.py | WFPColombia/nutrifami-recipes | b976efc366cb9f66108f3365a60b968eedfc1614 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.4 on 2017-09-12 17:42
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('recetas', '0014_auto_20170905_1934'),
]
operations... | 31.468085 | 131 | 0.580798 | from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('recetas', '0014_auto_20170905_1934'),
]
operations = [
migrations.CreateModel(
name='Unidad',
... | true | true |
f74c2d33b00167768a8e84020732f79bf952680f | 4,044 | py | Python | airflow/airflow_own/plugins/WRITER.py | vipksmosar/habr_rss_parse | 91fa3df3db3a1416348237919824696239d4cb29 | [
"Unlicense"
] | null | null | null | airflow/airflow_own/plugins/WRITER.py | vipksmosar/habr_rss_parse | 91fa3df3db3a1416348237919824696239d4cb29 | [
"Unlicense"
] | null | null | null | airflow/airflow_own/plugins/WRITER.py | vipksmosar/habr_rss_parse | 91fa3df3db3a1416348237919824696239d4cb29 | [
"Unlicense"
] | null | null | null | import os
try:
import pandas as pd
except:
os.system('pip3 install pandas')
import pandas as pd
try:
import psycopg2
except:
os.system('pip3 install psycopg2-binary')
import psycopg2
import numpy as np
from psycopg2.extensions import register_adapter, AsIs
psycopg2.extensions.register_adapter(np... | 35.787611 | 106 | 0.575915 | import os
try:
import pandas as pd
except:
os.system('pip3 install pandas')
import pandas as pd
try:
import psycopg2
except:
os.system('pip3 install psycopg2-binary')
import psycopg2
import numpy as np
from psycopg2.extensions import register_adapter, AsIs
psycopg2.extensions.register_adapter(np... | true | true |
f74c2d5a941fc17d253c1425643295b50d4f01ff | 1,220 | py | Python | drf_braces/tests/serializers/test_swapping.py | wlongo/django-rest-framework-braces | f1b6fcb20414280e19a7810c81ce68406ad2a305 | [
"MIT"
] | 80 | 2015-07-01T12:55:35.000Z | 2021-09-23T19:40:37.000Z | drf_braces/tests/serializers/test_swapping.py | wlongo/django-rest-framework-braces | f1b6fcb20414280e19a7810c81ce68406ad2a305 | [
"MIT"
] | 28 | 2015-07-03T11:37:38.000Z | 2022-02-28T02:56:08.000Z | drf_braces/tests/serializers/test_swapping.py | wlongo/django-rest-framework-braces | f1b6fcb20414280e19a7810c81ce68406ad2a305 | [
"MIT"
] | 16 | 2015-07-09T01:03:39.000Z | 2022-01-20T19:25:24.000Z | # -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
import unittest
from rest_framework import serializers
from ...serializers.swapping import SwappingSerializerMixin
class ChildSerializer(serializers.Serializer):
foo = serializers.IntegerField()
bar = serializer... | 29.756098 | 106 | 0.736066 | from __future__ import absolute_import, print_function, unicode_literals
import unittest
from rest_framework import serializers
from ...serializers.swapping import SwappingSerializerMixin
class ChildSerializer(serializers.Serializer):
foo = serializers.IntegerField()
bar = serializers.CharField()
class Ch... | true | true |
f74c2ea8d5c669f49118bb3c4002e45ef7da84dc | 3,883 | py | Python | tensorflow/lite/testing/op_tests/unroll_batch_matmul.py | where-is-brett/tensorflow | 5da8599b2cf9edfb9fac4431c705501bf7ceccd8 | [
"Apache-2.0"
] | 50 | 2020-03-15T01:04:36.000Z | 2021-11-21T23:25:44.000Z | tensorflow/lite/testing/op_tests/unroll_batch_matmul.py | where-is-brett/tensorflow | 5da8599b2cf9edfb9fac4431c705501bf7ceccd8 | [
"Apache-2.0"
] | 47 | 2020-05-15T11:30:04.000Z | 2021-08-11T16:51:08.000Z | tensorflow/lite/testing/op_tests/unroll_batch_matmul.py | where-is-brett/tensorflow | 5da8599b2cf9edfb9fac4431c705501bf7ceccd8 | [
"Apache-2.0"
] | 66 | 2020-05-15T10:05:12.000Z | 2022-02-14T07:28:18.000Z | # Copyright 2019 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... | 41.308511 | 80 | 0.639969 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow.compat.v1 as tf
from tensorflow.lite.testing.zip_test_utils import create_tensor_data
from tensorflow.lite.testing.zip_test_utils import make_zip_of_tests
from tensorflow.lite.testing.zip_test... | true | true |
f74c2ebe809db9c1f6af0d521c23dfb3ed53f180 | 6,864 | py | Python | vumi/transports/telnet/telnet.py | hnec-vr/vumi | b9c1100176a46774b502d5a0db225930a2d298c7 | [
"BSD-3-Clause"
] | null | null | null | vumi/transports/telnet/telnet.py | hnec-vr/vumi | b9c1100176a46774b502d5a0db225930a2d298c7 | [
"BSD-3-Clause"
] | null | null | null | vumi/transports/telnet/telnet.py | hnec-vr/vumi | b9c1100176a46774b502d5a0db225930a2d298c7 | [
"BSD-3-Clause"
] | null | null | null | # -*- test-case-name: vumi.transports.telnet.tests.test_telnet -*-
"""Transport that sends and receives to telnet clients."""
from twisted.internet import reactor
from twisted.internet.protocol import ServerFactory
from twisted.internet.defer import inlineCallbacks, Deferred, gatherResults
from twisted.conch.telnet i... | 33.980198 | 78 | 0.653409 |
from twisted.internet import reactor
from twisted.internet.protocol import ServerFactory
from twisted.internet.defer import inlineCallbacks, Deferred, gatherResults
from twisted.conch.telnet import (TelnetTransport, TelnetProtocol,
StatefulTelnetProtocol)
from twisted.python import... | true | true |
f74c2f4befd4067c390740b49db430c68c80cdb0 | 87 | py | Python | pythonNotes/samplePgms/io/propertiesFile/1_props_file_simple.py | itsraghz/TechNotes | 1fa87ec2231fa06f8c780a5399d16a0f5c769c94 | [
"CC0-1.0"
] | null | null | null | pythonNotes/samplePgms/io/propertiesFile/1_props_file_simple.py | itsraghz/TechNotes | 1fa87ec2231fa06f8c780a5399d16a0f5c769c94 | [
"CC0-1.0"
] | 1 | 2020-02-23T16:48:06.000Z | 2020-02-23T16:48:06.000Z | pythonNotes/samplePgms/io/propertiesFile/1_props_file_simple.py | itsraghz/TechNotes | 1fa87ec2231fa06f8c780a5399d16a0f5c769c94 | [
"CC0-1.0"
] | 1 | 2020-05-09T17:41:46.000Z | 2020-05-09T17:41:46.000Z | # Ref URL: https://stackoverflow.com/a/8220790/1001242
import dbProps
print(dbProps)
| 14.5 | 54 | 0.770115 |
import dbProps
print(dbProps)
| true | true |
f74c2f78588920a2d7eed43f4841a75d19b16d7b | 361 | py | Python | OneCent/story/migrations/0007_auto_20190703_2245.py | tobias-fyi/challenges | 4b4d2a8c5e24a51e33d78ab4191ebb843b788aca | [
"MIT"
] | null | null | null | OneCent/story/migrations/0007_auto_20190703_2245.py | tobias-fyi/challenges | 4b4d2a8c5e24a51e33d78ab4191ebb843b788aca | [
"MIT"
] | null | null | null | OneCent/story/migrations/0007_auto_20190703_2245.py | tobias-fyi/challenges | 4b4d2a8c5e24a51e33d78ab4191ebb843b788aca | [
"MIT"
] | null | null | null | # Generated by Django 2.2.2 on 2019-07-04 04:45
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('story', '0006_auto_20190703_2240'),
]
operations = [
migrations.RenameField(
model_name='story',
old_name='artist',
... | 19 | 47 | 0.581717 |
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('story', '0006_auto_20190703_2240'),
]
operations = [
migrations.RenameField(
model_name='story',
old_name='artist',
new_name='artwork',
),
]
| true | true |
f74c2f818b29270ec86cc6a228ac4b98548b96d6 | 15,213 | py | Python | Homework 4/107062240_hw4_train.py | ChristianLin0420/DeepRL | 143a9bfebd264229d9d26fcdc070065225774e04 | [
"MIT"
] | null | null | null | Homework 4/107062240_hw4_train.py | ChristianLin0420/DeepRL | 143a9bfebd264229d9d26fcdc070065225774e04 | [
"MIT"
] | null | null | null | Homework 4/107062240_hw4_train.py | ChristianLin0420/DeepRL | 143a9bfebd264229d9d26fcdc070065225774e04 | [
"MIT"
] | null | null | null | from osim.env import L2M2019Env
'''
TD3
'''
import copy
import numpy as np
import pandas as pd
import argparse
import os
import os.path
from os import path
import utils
from collections import Iterable
import torch
import torch.nn as nn
import torch.nn.functional as F
device = torch.device("cuda" if torch.cuda... | 34.186517 | 137 | 0.593243 | from osim.env import L2M2019Env
import copy
import numpy as np
import pandas as pd
import argparse
import os
import os.path
from os import path
import utils
from collections import Iterable
import torch
import torch.nn as nn
import torch.nn.functional as F
device = torch.device("cuda" if torch.cuda.is_available() ... | true | true |
f74c2fb39d5fcf882799632558ba265e2f829ff7 | 6,071 | py | Python | effector_database/views.py | LuukHenk/effector_database | d9702f89ffd2a23b4f5233d4ece69c1ceebd6164 | [
"MIT"
] | null | null | null | effector_database/views.py | LuukHenk/effector_database | d9702f89ffd2a23b4f5233d4ece69c1ceebd6164 | [
"MIT"
] | null | null | null | effector_database/views.py | LuukHenk/effector_database | d9702f89ffd2a23b4f5233d4ece69c1ceebd6164 | [
"MIT"
] | null | null | null | from django.contrib import messages
from django.core.exceptions import ObjectDoesNotExist
from django.http import HttpResponseRedirect
from django.shortcuts import render, get_object_or_404
from django.urls import reverse
from .models import Sequence
from .forms import SequenceForm
def index(request):
""" Redirec... | 40.205298 | 100 | 0.689837 | from django.contrib import messages
from django.core.exceptions import ObjectDoesNotExist
from django.http import HttpResponseRedirect
from django.shortcuts import render, get_object_or_404
from django.urls import reverse
from .models import Sequence
from .forms import SequenceForm
def index(request):
return Http... | true | true |
f74c3069f437cb2e04c89010f82c827fe872c69f | 3,135 | py | Python | rosWorkspace/SubDepthController/src/SubDepthController/msg/_mixer.py | chris-blay/guillemot-core | 5e20bf46c10da2e6b57c3293a9d9aa402c864288 | [
"Apache-2.0"
] | null | null | null | rosWorkspace/SubDepthController/src/SubDepthController/msg/_mixer.py | chris-blay/guillemot-core | 5e20bf46c10da2e6b57c3293a9d9aa402c864288 | [
"Apache-2.0"
] | null | null | null | rosWorkspace/SubDepthController/src/SubDepthController/msg/_mixer.py | chris-blay/guillemot-core | 5e20bf46c10da2e6b57c3293a9d9aa402c864288 | [
"Apache-2.0"
] | null | null | null | """autogenerated by genpy from SubDepthController/mixer.msg. Do not edit."""
import sys
python3 = True if sys.hexversion > 0x03000000 else False
import genpy
import struct
class mixer(genpy.Message):
_md5sum = "ba840d81d8a0efbe22902b684b543995"
_type = "SubDepthController/mixer"
_has_header = False #flag to mar... | 29.299065 | 91 | 0.6689 | import sys
python3 = True if sys.hexversion > 0x03000000 else False
import genpy
import struct
class mixer(genpy.Message):
_md5sum = "ba840d81d8a0efbe22902b684b543995"
_type = "SubDepthController/mixer"
_has_header = False _full_text = """float32 value
float32 confidence
"""
__slots__ = ['value','confidenc... | true | true |
f74c314ab2331bd519d1be84026a6990fdefa550 | 271 | py | Python | drug_shortage/apps/upload_and_clean_excel/admin.py | duqian91/drug_shortage | 70cd1692ceb01098335cb3ee7c59a221ff6d6390 | [
"MIT"
] | null | null | null | drug_shortage/apps/upload_and_clean_excel/admin.py | duqian91/drug_shortage | 70cd1692ceb01098335cb3ee7c59a221ff6d6390 | [
"MIT"
] | null | null | null | drug_shortage/apps/upload_and_clean_excel/admin.py | duqian91/drug_shortage | 70cd1692ceb01098335cb3ee7c59a221ff6d6390 | [
"MIT"
] | null | null | null | from django.contrib import admin
from import_export.admin import ImportExportActionModelAdmin
from .models import Medication
# Register your models here.
class MedicationAdmin(ImportExportActionModelAdmin):
pass
admin.site.register(Medication, MedicationAdmin)
| 19.357143 | 60 | 0.833948 | from django.contrib import admin
from import_export.admin import ImportExportActionModelAdmin
from .models import Medication
class MedicationAdmin(ImportExportActionModelAdmin):
pass
admin.site.register(Medication, MedicationAdmin)
| true | true |
f74c315992625640864b2a512be0ec35c8cec91d | 24,457 | py | Python | ailment/expression.py | angr/ailment | 638496df6547662517f5f524c9bde4b53fcbd176 | [
"BSD-2-Clause"
] | 16 | 2017-08-29T02:07:28.000Z | 2022-01-05T07:38:41.000Z | ailment/expression.py | angr/ailment | 638496df6547662517f5f524c9bde4b53fcbd176 | [
"BSD-2-Clause"
] | 18 | 2018-09-25T15:01:46.000Z | 2022-03-23T22:28:04.000Z | ailment/expression.py | angr/ailment | 638496df6547662517f5f524c9bde4b53fcbd176 | [
"BSD-2-Clause"
] | 19 | 2017-08-29T02:07:29.000Z | 2021-12-15T07:09:19.000Z | # pylint:disable=arguments-renamed,isinstance-second-argument-not-valid-type
try:
import claripy
except ImportError:
claripy = None
from .tagged_object import TaggedObject
from .utils import get_bits, stable_hash
class Expression(TaggedObject):
"""
The base class of all AIL expressions.
"""
... | 30.91909 | 119 | 0.589361 | try:
import claripy
except ImportError:
claripy = None
from .tagged_object import TaggedObject
from .utils import get_bits, stable_hash
class Expression(TaggedObject):
__slots__ = ('depth', )
def __init__(self, idx, depth, **kwargs):
super().__init__(idx, **kwargs)
self.depth = dept... | true | true |
f74c31c6e21b4dfac44cb448993b50341b74ac92 | 17,952 | py | Python | service/routes.py | shopcarts-nyu/shopcart | 9a58ae2c08d33ef2d0175d7b52cd36c0fd603fb2 | [
"Apache-2.0"
] | null | null | null | service/routes.py | shopcarts-nyu/shopcart | 9a58ae2c08d33ef2d0175d7b52cd36c0fd603fb2 | [
"Apache-2.0"
] | 22 | 2022-02-25T16:10:53.000Z | 2022-03-29T22:12:42.000Z | service/routes.py | shopcarts-nyu/shopcart | 9a58ae2c08d33ef2d0175d7b52cd36c0fd603fb2 | [
"Apache-2.0"
] | 1 | 2022-03-17T20:20:43.000Z | 2022-03-17T20:20:43.000Z | """
ShopCart Service
Paths:
------
GET /shopcarts - Returns a list all of the ShopCarts
POST /shopcarts - creates a new ShopCart record in the database
POST /shopcarts/{customer_id}/items - add an item to the shopcart for customer_id
GET /shopcarts/{customer_id} - Returns the ShopCart with a given id number
GET /shopca... | 45.448101 | 123 | 0.583612 |
import os
import sys
import logging
from flask import Flask, request, url_for, make_response, abort
from flask_restx import Api, Resource, fields, reqparse, inputs
from service.models import ShopCart, DataValidationError, DatabaseConnectionError
from . import status from werkzeug.exceptions import NotFound
# variety... | true | true |
f74c328b4e8be5db4ab0478db22db83a43dfc36e | 38,645 | py | Python | petitions/migrations/01000_add_counties_subcounties_courts_prisons_offences.py | DavidWaichari/pomac | 79273c34dc54a301ed9fd802b0c2c487b2ac5d92 | [
"MIT"
] | null | null | null | petitions/migrations/01000_add_counties_subcounties_courts_prisons_offences.py | DavidWaichari/pomac | 79273c34dc54a301ed9fd802b0c2c487b2ac5d92 | [
"MIT"
] | null | null | null | petitions/migrations/01000_add_counties_subcounties_courts_prisons_offences.py | DavidWaichari/pomac | 79273c34dc54a301ed9fd802b0c2c487b2ac5d92 | [
"MIT"
] | null | null | null | # Generated by Django 2.0.1 on 2018-01-28 19:30
from django.db import migrations
def add_initial_data(apps, schema_editor):
County = apps.get_model('petitions', 'County')
Court = apps.get_model('petitions', 'Court')
SubCounty = apps.get_model('petitions', 'SubCounty')
Prison = apps.get_model('petit... | 56.25182 | 112 | 0.73712 |
from django.db import migrations
def add_initial_data(apps, schema_editor):
County = apps.get_model('petitions', 'County')
Court = apps.get_model('petitions', 'Court')
SubCounty = apps.get_model('petitions', 'SubCounty')
Prison = apps.get_model('petitions', 'Prison')
Offence = apps.get_model('p... | true | true |
f74c32c462fc4f863e16f54c7d43ff6a5e970095 | 2,358 | py | Python | slybot/slybot/fieldtypes/text.py | ruairif/portia | 175b1f5bbec50fda6adda042481bd09c77d12bf0 | [
"BSD-3-Clause"
] | 8 | 2015-03-16T20:30:50.000Z | 2021-09-21T13:05:46.000Z | slybot/slybot/fieldtypes/text.py | btomashvili/portia | 9039140269f2cfca588a1feec6cc793cba87f202 | [
"BSD-3-Clause"
] | 1 | 2018-10-24T09:29:00.000Z | 2018-10-24T09:29:00.000Z | slybot/slybot/fieldtypes/text.py | btomashvili/portia | 9039140269f2cfca588a1feec6cc793cba87f202 | [
"BSD-3-Clause"
] | 4 | 2015-02-01T01:17:45.000Z | 2022-03-04T06:07:25.000Z | """
Text types
"""
from scrapely.extractors import text as extract_text, safehtml
class _BaseTextProcessor(object):
"""basic text processor, defines identity functions, some of which
are overridden in subclasses
"""
def extract(self, text):
"""Matches and extracts any string, as it is"""
... | 29.848101 | 85 | 0.635284 | from scrapely.extractors import text as extract_text, safehtml
class _BaseTextProcessor(object):
def extract(self, text):
return text
def adapt(self, text, htmlpage):
return text
class RawFieldTypeProcessor(_BaseTextProcessor):
name = 'raw html'
description = 'raw html as it a... | true | true |
f74c333572f763c53c0c3c8e2fe92288b3810986 | 834 | py | Python | tests/unit/test_sweep.py | ilanreiter/Recommenders | 32994bfa0e4fa567f7afa5c523d1086d6c4272f0 | [
"MIT"
] | 5 | 2020-02-12T23:40:11.000Z | 2021-09-23T13:10:31.000Z | tests/unit/test_sweep.py | Microsoft/MLOpsSamples | 799172ccedde9875862c169a7edd6da74cff7726 | [
"MIT"
] | null | null | null | tests/unit/test_sweep.py | Microsoft/MLOpsSamples | 799172ccedde9875862c169a7edd6da74cff7726 | [
"MIT"
] | 8 | 2019-11-06T22:27:02.000Z | 2022-03-28T13:17:55.000Z | import pandas as pd
import pytest
from reco_utils.evaluation.parameter_sweep import generate_param_grid
@pytest.fixture(scope="module")
def parameter_dictionary():
params = {
"param1": [1, 2, 3],
"param2": [4, 5, 6],
"param3": 1
}
return params
def test_param_sweep(parameter_di... | 29.785714 | 89 | 0.571942 | import pandas as pd
import pytest
from reco_utils.evaluation.parameter_sweep import generate_param_grid
@pytest.fixture(scope="module")
def parameter_dictionary():
params = {
"param1": [1, 2, 3],
"param2": [4, 5, 6],
"param3": 1
}
return params
def test_param_sweep(parameter_di... | true | true |
f74c33693e5338354631c922259b4c68605123c0 | 1,766 | py | Python | libraries/botbuilder-schema/botbuilder/schema/geo_coordinates.py | matthewshim-ms/botbuilder-python | f3dbce50de01a43afdcf3efdbdca6e0d5c96dc98 | [
"MIT"
] | null | null | null | libraries/botbuilder-schema/botbuilder/schema/geo_coordinates.py | matthewshim-ms/botbuilder-python | f3dbce50de01a43afdcf3efdbdca6e0d5c96dc98 | [
"MIT"
] | null | null | null | libraries/botbuilder-schema/botbuilder/schema/geo_coordinates.py | matthewshim-ms/botbuilder-python | f3dbce50de01a43afdcf3efdbdca6e0d5c96dc98 | [
"MIT"
] | null | null | null | # 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 ... | 36.791667 | 92 | 0.601359 |
from msrest.serialization import Model
class GeoCoordinates(Model):
_attribute_map = {
'elevation': {'key': 'elevation', 'type': 'float'},
'latitude': {'key': 'latitude', 'type': 'float'},
'longitude': {'key': 'longitude', 'type': 'float'},
'type': {'key': 'type', 'type': 'str'},... | true | true |
f74c33a06b7985000b721836d4db9a34577cd949 | 912 | py | Python | scripts2/rxn_to_connections.py | ericHester/metabolicOverlap | 8582d6598bfe43a71f68a5df213e00340e69eec6 | [
"MIT"
] | null | null | null | scripts2/rxn_to_connections.py | ericHester/metabolicOverlap | 8582d6598bfe43a71f68a5df213e00340e69eec6 | [
"MIT"
] | null | null | null | scripts2/rxn_to_connections.py | ericHester/metabolicOverlap | 8582d6598bfe43a71f68a5df213e00340e69eec6 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
#reaction_find_connections - find connections between organisms
import sys
organisms = {}
for filename in sys.argv[1:]:
with open(filename) as current:
organisms[filename] = {'ins': set(), 'outs': set()}
for line in current:
record = line.rstrip('\n').split('\t')
... | 38 | 72 | 0.5625 | import sys
organisms = {}
for filename in sys.argv[1:]:
with open(filename) as current:
organisms[filename] = {'ins': set(), 'outs': set()}
for line in current:
record = line.rstrip('\n').split('\t')
organisms[filename]['ins'].update(record[1].split('+'))
organis... | true | true |
f74c3449c1a836f4982b36102f3d0726cea42c0a | 1,663 | py | Python | src/webpack_loader_remote/templatetags/webpack_loader_remote.py | alexseitsinger/django-webpack-loader-remote | ad68c61e22e8ff72a8fe8ba2df2c120a5eaf5e3b | [
"MIT"
] | null | null | null | src/webpack_loader_remote/templatetags/webpack_loader_remote.py | alexseitsinger/django-webpack-loader-remote | ad68c61e22e8ff72a8fe8ba2df2c120a5eaf5e3b | [
"MIT"
] | null | null | null | src/webpack_loader_remote/templatetags/webpack_loader_remote.py | alexseitsinger/django-webpack-loader-remote | ad68c61e22e8ff72a8fe8ba2df2c120a5eaf5e3b | [
"MIT"
] | null | null | null | from django import template, VERSION
from django.conf import settings
from django.utils.safestring import mark_safe
from .. import utils
register = template.Library()
@register.simple_tag
def render_presigned_bundle(
bundle_name,
bucket_name,
prefix=None,
expiration=None,
extension=None,
con... | 26.396825 | 86 | 0.704149 | from django import template, VERSION
from django.conf import settings
from django.utils.safestring import mark_safe
from .. import utils
register = template.Library()
@register.simple_tag
def render_presigned_bundle(
bundle_name,
bucket_name,
prefix=None,
expiration=None,
extension=None,
con... | true | true |
f74c3484eea39d3ac0bbdda97fbdfe95c8f05330 | 806 | py | Python | DjangoErp/urls.py | liuyubeyond1121/DjangoErp | fc1915e6738616397f0e82e02971b53416c96bbf | [
"MIT"
] | null | null | null | DjangoErp/urls.py | liuyubeyond1121/DjangoErp | fc1915e6738616397f0e82e02971b53416c96bbf | [
"MIT"
] | null | null | null | DjangoErp/urls.py | liuyubeyond1121/DjangoErp | fc1915e6738616397f0e82e02971b53416c96bbf | [
"MIT"
] | null | null | null | """DjangoErp URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-bas... | 33.583333 | 77 | 0.705955 | from django.contrib import admin
from django.urls import path
import xadmin
urlpatterns = [
path('xadmin/', xadmin.site.urls),
]
| true | true |
f74c351db9203b291f30697ae8a98cdfe8ebc58e | 86 | py | Python | app/config.py | directedbyshawn/Secure-Login | 15f2a6168986b11ffbde318333415671fb62578f | [
"MIT"
] | null | null | null | app/config.py | directedbyshawn/Secure-Login | 15f2a6168986b11ffbde318333415671fb62578f | [
"MIT"
] | null | null | null | app/config.py | directedbyshawn/Secure-Login | 15f2a6168986b11ffbde318333415671fb62578f | [
"MIT"
] | null | null | null | '''
Flask app config.
'''
DB_FILE = 'app/instance/var/db/users.db'
display = {} | 10.75 | 40 | 0.593023 |
DB_FILE = 'app/instance/var/db/users.db'
display = {} | true | true |
f74c37206f6f52e32821cd41254082ea037a72dc | 2,134 | py | Python | recommender_vanilla.py | gptix/DS--Data-Engineering- | 2975e4b538aed3e477bea56f0b09601452ed4837 | [
"MIT"
] | 1 | 2020-03-03T18:01:35.000Z | 2020-03-03T18:01:35.000Z | recommender_vanilla.py | gptix/DS--Data-Engineering- | 2975e4b538aed3e477bea56f0b09601452ed4837 | [
"MIT"
] | null | null | null | recommender_vanilla.py | gptix/DS--Data-Engineering- | 2975e4b538aed3e477bea56f0b09601452ed4837 | [
"MIT"
] | null | null | null | import numpy as np
import pandas as pd
from sklearn.neighbors import NearestNeighbors
from sklearn.feature_extraction.text import CountVectorizer
### Import and shape data
path_base = 'gitstuff/buildweek2/DS--Data-Engineering-/'
df = pd.read_csv(path_base + 'data/cannabis.csv')
## select subset with high rating
good... | 30.485714 | 102 | 0.704311 | import numpy as np
import pandas as pd
from sklearn.neighbors import NearestNeighbors
from sklearn.feature_extraction.text import CountVectorizer
path_base = 'gitstuff/buildweek2/DS--Data-Engineering-/'
df = pd.read_csv(path_base + 'data/cannabis.csv')
good_enough = df[df['Rating'] >= 4.0]
good_enough = df.replace(... | true | true |
f74c38398242b17a9da905204af4476203638225 | 5,219 | py | Python | photons/equipment/__init__.py | MSLNZ/pr-single-photons | b3f52d2a2a7cf5385d885f30ae9555e1e7d77ec2 | [
"MIT"
] | null | null | null | photons/equipment/__init__.py | MSLNZ/pr-single-photons | b3f52d2a2a7cf5385d885f30ae9555e1e7d77ec2 | [
"MIT"
] | null | null | null | photons/equipment/__init__.py | MSLNZ/pr-single-photons | b3f52d2a2a7cf5385d885f30ae9555e1e7d77ec2 | [
"MIT"
] | null | null | null | """
Custom classes for communicating with equipment.
"""
import importlib
import logging
import os
import weakref
from msl.qt import QtCore
from msl.network import Service
from msl.io import search
from msl.equipment.utils import convert_to_enum
from .. import (
logger,
Register,
)
registry = []
""":class:`l... | 37.278571 | 113 | 0.65549 | import importlib
import logging
import os
import weakref
from msl.qt import QtCore
from msl.network import Service
from msl.io import search
from msl.equipment.utils import convert_to_enum
from .. import (
logger,
Register,
)
registry = []
class BaseEquipment(QtCore.QObject, Service):
def __init__(sel... | true | true |
f74c384ded7045a51081ec6f916471a0fbd24794 | 2,480 | py | Python | irlib/matrixcooccurrence.py | gr33ndata/irlib | 4a518fec994b1a89cdc7d09a8170efec3d7e6615 | [
"MIT"
] | 80 | 2015-02-16T18:33:57.000Z | 2021-05-06T02:03:22.000Z | irlib/matrixcooccurrence.py | gr33ndata/irlib | 4a518fec994b1a89cdc7d09a8170efec3d7e6615 | [
"MIT"
] | 2 | 2016-02-05T06:30:21.000Z | 2017-09-24T17:42:58.000Z | irlib/matrixcooccurrence.py | gr33ndata/irlib | 4a518fec994b1a89cdc7d09a8170efec3d7e6615 | [
"MIT"
] | 25 | 2015-05-13T17:35:41.000Z | 2020-06-04T01:52:11.000Z | '''
Informations Retrieval Library
==============================
MatrixCooccurrence: You give it a Matrix,
and it creates new co-occurrence matrix of its features
'''
# Author: Tarek Amr <@gr33ndata>
import sys, math
from matrix import Matrix
from superlist import SuperList
from itertools import permutations
cla... | 28.181818 | 62 | 0.523387 | '''
Informations Retrieval Library
==============================
MatrixCooccurrence: You give it a Matrix,
and it creates new co-occurrence matrix of its features
'''
import sys, math
from matrix import Matrix
from superlist import SuperList
from itertools import permutations
class MatrixCooccurrence(Matrix):
... | false | true |
f74c3873bd8f7654a0bf96d27581d021fcf54999 | 2,079 | py | Python | openpyxl/chart/tests/test_text.py | VariantXYZ/openpyxl-variant | 873cc3dda43578c098843ebe930325c879d20baf | [
"MIT"
] | null | null | null | openpyxl/chart/tests/test_text.py | VariantXYZ/openpyxl-variant | 873cc3dda43578c098843ebe930325c879d20baf | [
"MIT"
] | null | null | null | openpyxl/chart/tests/test_text.py | VariantXYZ/openpyxl-variant | 873cc3dda43578c098843ebe930325c879d20baf | [
"MIT"
] | null | null | null | # Copyright (c) 2010-2020 openpyxl
import pytest
from openpyxl.xml.functions import fromstring, tostring
from openpyxl.tests.helper import compare_xml
@pytest.fixture
def RichText():
from ..text import RichText
return RichText
class TestRichText:
def test_ctor(self, RichText):
text = RichText... | 21.65625 | 78 | 0.513228 |
import pytest
from openpyxl.xml.functions import fromstring, tostring
from openpyxl.tests.helper import compare_xml
@pytest.fixture
def RichText():
from ..text import RichText
return RichText
class TestRichText:
def test_ctor(self, RichText):
text = RichText()
xml = tostring(text.to_t... | true | true |
f74c38851cb0759bac3dccf7a6ba85c383630efb | 6,395 | py | Python | CNN/CNN_line.py | plutolove/Motor-life-prediction | 2ed95a4d5e2c0ed649a6da2299ba33dee932b569 | [
"MIT"
] | 3 | 2017-07-19T10:37:58.000Z | 2018-03-21T07:09:15.000Z | CNN/CNN_line.py | plutolove/Motor-life-prediction | 2ed95a4d5e2c0ed649a6da2299ba33dee932b569 | [
"MIT"
] | 1 | 2019-06-27T10:01:03.000Z | 2019-06-27T10:01:03.000Z | CNN/CNN_line.py | plutolove/Motor-life-prediction | 2ed95a4d5e2c0ed649a6da2299ba33dee932b569 | [
"MIT"
] | 2 | 2017-07-19T10:37:59.000Z | 2020-07-08T14:45:16.000Z | import os
from keras.callbacks import EarlyStopping
from sklearn import preprocessing
from sklearn.utils import shuffle
from keras.models import Sequential
from keras.layers import Dense, Dropout, Flatten
from keras.layers import Conv2D, MaxPooling2D
import keras
import seaborn as sns
import pandas as pd
import numpy a... | 34.567568 | 205 | 0.59312 | import os
from keras.callbacks import EarlyStopping
from sklearn import preprocessing
from sklearn.utils import shuffle
from keras.models import Sequential
from keras.layers import Dense, Dropout, Flatten
from keras.layers import Conv2D, MaxPooling2D
import keras
import seaborn as sns
import pandas as pd
import numpy a... | false | true |
f74c3a8a3fdfdc4b2a7125cfe209afffb12381fa | 3,556 | py | Python | tools/test_net.py | klockeph/MV3D_TF | 4e1bb30b36218c28ada25886212f76b493ea2584 | [
"MIT"
] | 124 | 2017-07-17T13:28:46.000Z | 2022-03-13T15:23:47.000Z | tools/test_net.py | klockeph/MV3D_TF | 4e1bb30b36218c28ada25886212f76b493ea2584 | [
"MIT"
] | 2 | 2017-12-19T12:51:25.000Z | 2019-05-12T06:02:46.000Z | tools/test_net.py | klockeph/MV3D_TF | 4e1bb30b36218c28ada25886212f76b493ea2584 | [
"MIT"
] | 45 | 2017-07-16T14:49:11.000Z | 2022-02-22T03:24:17.000Z | #!/usr/bin/env python
# --------------------------------------------------------
# Fast R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ross Girshick
# --------------------------------------------------------
"""Test a Fast R-CNN network on an image databas... | 32.925926 | 81 | 0.597019 |
"""Test a Fast R-CNN network on an image database."""
import _init_paths
from fast_rcnn.test_mv import test_net
from fast_rcnn.config import cfg, cfg_from_file
from datasets.factory import get_imdb
from networks.factory import get_network
import argparse
import pprint
import time, os, sys
import tensorflow as tf
de... | false | true |
f74c3b396eb0cfbd452e7b79d9f6ed3521f6d6de | 1,095 | py | Python | jirainfo/jirahelper.py | hypebeast/jira-info | a7642aa90f5f77f56898c5b53d1e850fcd4a982c | [
"MIT"
] | 1 | 2015-08-19T07:36:36.000Z | 2015-08-19T07:36:36.000Z | jirainfo/jirahelper.py | hypebeast/jira-info | a7642aa90f5f77f56898c5b53d1e850fcd4a982c | [
"MIT"
] | null | null | null | jirainfo/jirahelper.py | hypebeast/jira-info | a7642aa90f5f77f56898c5b53d1e850fcd4a982c | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import click
from jira import JIRA, JIRAError
from jirainfo.helpers import printJiraErrorAndExit, printErrorMsg
class JiraHelper(object):
def __init__(self, host, user="", password=""):
self.host = host
self.user = user
self.password = password
try:
... | 28.815789 | 110 | 0.579909 |
import click
from jira import JIRA, JIRAError
from jirainfo.helpers import printJiraErrorAndExit, printErrorMsg
class JiraHelper(object):
def __init__(self, host, user="", password=""):
self.host = host
self.user = user
self.password = password
try:
if user != "" and p... | true | true |
f74c3b3c091e218276bfe1b1c8c61621dbd615e2 | 658 | py | Python | generate_dmrpp.py | amarouane-ABDELHAK/dmrpp-file-generator-docker | 85210b80d4204c5ca5325fe7167c7e1cd8ea62e8 | [
"Apache-2.0"
] | null | null | null | generate_dmrpp.py | amarouane-ABDELHAK/dmrpp-file-generator-docker | 85210b80d4204c5ca5325fe7167c7e1cd8ea62e8 | [
"Apache-2.0"
] | null | null | null | generate_dmrpp.py | amarouane-ABDELHAK/dmrpp-file-generator-docker | 85210b80d4204c5ca5325fe7167c7e1cd8ea62e8 | [
"Apache-2.0"
] | 1 | 2021-03-24T17:23:12.000Z | 2021-03-24T17:23:12.000Z | from os import listdir
from os.path import isfile, join, basename
from dmrpp_generator.main import DMRPPGenerator
from re import match
if __name__ == "__main__":
workstation_path = "/workstation/"
join_path = lambda x: join(workstation_path, x)
input_files = [join_path(f) for f in listdir(workstation_path... | 43.866667 | 118 | 0.659574 | from os import listdir
from os.path import isfile, join, basename
from dmrpp_generator.main import DMRPPGenerator
from re import match
if __name__ == "__main__":
workstation_path = "/workstation/"
join_path = lambda x: join(workstation_path, x)
input_files = [join_path(f) for f in listdir(workstation_path... | true | true |
f74c3c3ca84aefc28c921d18f0c52edf55841aa6 | 2,062 | py | Python | data/datasets_downloader.py | liorgreenb/cartoon-face-domain-transfer | be439c24a1432ffc5bc9a50734c31bb4758cc679 | [
"MIT"
] | 1 | 2020-09-29T02:00:28.000Z | 2020-09-29T02:00:28.000Z | data/datasets_downloader.py | liorgreenb/cartoon-face-domain-transfer | be439c24a1432ffc5bc9a50734c31bb4758cc679 | [
"MIT"
] | null | null | null | data/datasets_downloader.py | liorgreenb/cartoon-face-domain-transfer | be439c24a1432ffc5bc9a50734c31bb4758cc679 | [
"MIT"
] | 1 | 2021-05-29T16:35:21.000Z | 2021-05-29T16:35:21.000Z | import hashlib
import os
import shutil
from urllib.request import urlretrieve
from tqdm import tqdm
from constants import CELEB_A_URL, CELEB_A_HASH
from services import _unzip
def download_cartoonset10k():
print("downloading cartoonset10k dataset")
os.system("gsutil cp gs://cartoonset_public_files/cartoonset... | 31.723077 | 110 | 0.668768 | import hashlib
import os
import shutil
from urllib.request import urlretrieve
from tqdm import tqdm
from constants import CELEB_A_URL, CELEB_A_HASH
from services import _unzip
def download_cartoonset10k():
print("downloading cartoonset10k dataset")
os.system("gsutil cp gs://cartoonset_public_files/cartoonset... | true | true |
f74c3c485a3a675540fd5cbc16f751a024c024ac | 589 | py | Python | server/routes/health.py | Qebuqci/qebuqci-python-microservice | 795b1b75979f5be8f866639c585c9f9b31dec685 | [
"MIT"
] | null | null | null | server/routes/health.py | Qebuqci/qebuqci-python-microservice | 795b1b75979f5be8f866639c585c9f9b31dec685 | [
"MIT"
] | null | null | null | server/routes/health.py | Qebuqci/qebuqci-python-microservice | 795b1b75979f5be8f866639c585c9f9b31dec685 | [
"MIT"
] | null | null | null |
from flask import jsonify
from server import app
@app.route("/health")
def health():
"""health route"""
state = {"status": "UP"}
return jsonify(state)
@app.route('/answer')
def answer():
answer = {'The Answer to Life the Universe and Everything': 42}
return jsonify(answer)
@app.route('/answer/<n... | 25.608696 | 89 | 0.641766 |
from flask import jsonify
from server import app
@app.route("/health")
def health():
state = {"status": "UP"}
return jsonify(state)
@app.route('/answer')
def answer():
answer = {'The Answer to Life the Universe and Everything': 42}
return jsonify(answer)
@app.route('/answer/<number>')
def CheckAnswe... | true | true |
f74c3c67f9ce0c6b555b176a3221f40315519343 | 1,450 | py | Python | utils/preprocessing/create-json.py | simra/msrflute | c28e2e6bcfa9464b8640ccd625393bbed28491c3 | [
"MIT"
] | 29 | 2021-11-30T16:18:04.000Z | 2022-03-29T13:47:20.000Z | utils/preprocessing/create-json.py | simra/msrflute | c28e2e6bcfa9464b8640ccd625393bbed28491c3 | [
"MIT"
] | 2 | 2022-01-07T19:53:26.000Z | 2022-01-21T05:10:17.000Z | utils/preprocessing/create-json.py | simra/msrflute | c28e2e6bcfa9464b8640ccd625393bbed28491c3 | [
"MIT"
] | 5 | 2021-12-07T05:14:12.000Z | 2022-03-22T16:17:26.000Z | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import json
import time
from tqdm import tqdm
import pandas as pd
path = r'C:\Users\train.tsv'
def local_time():
return str(time.strftime("%H:%M:%S",time.localtime()))
print(local_time() + " Starting script " )
columns = ['author','nu... | 32.222222 | 102 | 0.688276 |
import json
import time
from tqdm import tqdm
import pandas as pd
path = r'C:\Users\train.tsv'
def local_time():
return str(time.strftime("%H:%M:%S",time.localtime()))
print(local_time() + " Starting script " )
columns = ['author','num1','content','str1','str2','num2','subreddit']
df = pd.read_csv(path, se... | true | true |
f74c3c9ff5dd15e22e035c3c92cc19aa2014552a | 2,469 | py | Python | discount_cashflows/discount_cashflows.py | hnguye12333/Python_ | 6aebb00d18ff5f276e6d1cc006c5e664bf9252eb | [
"MIT"
] | 6 | 2020-06-13T12:00:14.000Z | 2021-09-12T13:33:08.000Z | discount_cashflows/discount_cashflows.py | hnguye12333/Python_ | 6aebb00d18ff5f276e6d1cc006c5e664bf9252eb | [
"MIT"
] | null | null | null | discount_cashflows/discount_cashflows.py | hnguye12333/Python_ | 6aebb00d18ff5f276e6d1cc006c5e664bf9252eb | [
"MIT"
] | 5 | 2020-07-23T03:37:19.000Z | 2021-12-03T11:59:57.000Z | path_cashflow = r"./Cashflows.csv"
path_rate = r"./Yield curve.csv"
# Implementation with Pandas
import pandas as pd
# Read in the cash flows data and rate data as csv
cashflow_df = pd.read_csv(path_cashflow)
rate_df = pd.read_csv(path_rate)
# Calculate discount factor from the rates
rate_df["Discount factor"] = 1 /... | 34.291667 | 109 | 0.757797 | path_cashflow = r"./Cashflows.csv"
path_rate = r"./Yield curve.csv"
import pandas as pd
cashflow_df = pd.read_csv(path_cashflow)
rate_df = pd.read_csv(path_rate)
rate_df["Discount factor"] = 1 / (1 + rate_df["Interest rate"])**rate_df["Year"]
cf_with_rate_df = cashflow_df.merge(rate_df, on=["Currency", "Year"], how... | true | true |
f74c3e6ac712132339d9a64dcf78a87c5b2c02e0 | 1,048 | py | Python | tests/fiaas_skipper/web/test_metrics.py | eduramirezh/skipper | 6cf87b4753f6c0998eaaca8073266173e31b04f6 | [
"Apache-2.0"
] | 7 | 2018-05-02T14:00:56.000Z | 2022-01-13T09:31:28.000Z | tests/fiaas_skipper/web/test_metrics.py | eduramirezh/skipper | 6cf87b4753f6c0998eaaca8073266173e31b04f6 | [
"Apache-2.0"
] | 43 | 2018-03-27T13:35:20.000Z | 2022-03-23T09:02:35.000Z | tests/fiaas_skipper/web/test_metrics.py | eduramirezh/skipper | 6cf87b4753f6c0998eaaca8073266173e31b04f6 | [
"Apache-2.0"
] | 7 | 2020-06-26T08:54:41.000Z | 2022-03-17T11:49:32.000Z | #!/usr/bin/env python
# -*- coding: utf-8
# Copyright 2017-2019 The FIAAS 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
#
# U... | 29.111111 | 74 | 0.726145 |
from __future__ import absolute_import
import pytest
from flask import Flask
from fiaas_skipper.web.metrics import metrics
class TestMetrics(object):
@pytest.fixture
def app(self):
app = Flask(__name__)
app.register_blueprint(metrics)
return app.test_client()
def test_metrics(... | true | true |
f74c3fce1ad549692eabcc7aa824665c8643f9f0 | 5,621 | py | Python | batchflow/models/torch/network.py | analysiscenter/dataset | 50a0607442bd2eb675c8f6a8d7bc5e9dbabe36c0 | [
"Apache-2.0"
] | 101 | 2017-06-05T07:33:54.000Z | 2018-10-28T04:55:23.000Z | batchflow/models/torch/network.py | analysiscenter/dataset | 50a0607442bd2eb675c8f6a8d7bc5e9dbabe36c0 | [
"Apache-2.0"
] | 23 | 2017-11-08T20:01:58.000Z | 2018-07-15T09:08:02.000Z | batchflow/models/torch/network.py | analysiscenter/dataset | 50a0607442bd2eb675c8f6a8d7bc5e9dbabe36c0 | [
"Apache-2.0"
] | 23 | 2017-06-06T05:13:37.000Z | 2018-11-01T14:33:38.000Z | """ Network class: a model, made from multiple parts (modules). """
from torch import nn
from .repr_mixin import ModuleDictReprMixin
from .modules import (DefaultModule,
EncoderModule, DecoderModule, MLPDecoderModule,
HuggingFaceLoader, TIMMLoader)
from .utils import get_sha... | 42.263158 | 114 | 0.639922 | from torch import nn
from .repr_mixin import ModuleDictReprMixin
from .modules import (DefaultModule,
EncoderModule, DecoderModule, MLPDecoderModule,
HuggingFaceLoader, TIMMLoader)
from .utils import get_shape, get_device, make_initialization_inputs, make_shallow_dict
cla... | true | true |
f74c400d927c3004785f0cf10d68d480f9d7714c | 10,758 | py | Python | btools/building/customobj.py | proteanblank/building_tool | 920bb33dbc7d386ba8c2f669c90bddd9efd9aaf2 | [
"MIT"
] | 559 | 2020-07-02T21:06:38.000Z | 2022-03-30T17:58:56.000Z | btools/building/customobj.py | cokar/building_tools | 920bb33dbc7d386ba8c2f669c90bddd9efd9aaf2 | [
"MIT"
] | 63 | 2020-07-02T16:23:27.000Z | 2022-03-09T11:33:06.000Z | btools/building/customobj.py | cokar/building_tools | 920bb33dbc7d386ba8c2f669c90bddd9efd9aaf2 | [
"MIT"
] | 59 | 2020-07-05T06:14:23.000Z | 2022-03-12T03:22:18.000Z | """
Tools to allow users to place custom meshes on a building
"""
import bpy
import bmesh
from mathutils import Matrix, Vector
from bpy.props import PointerProperty
from .facemap import (
FaceMap,
add_faces_to_map,
add_facemap_for_groups
)
from ..utils import (
select,
local_xyz,
... | 34.152381 | 116 | 0.669548 | import bpy
import bmesh
from mathutils import Matrix, Vector
from bpy.props import PointerProperty
from .facemap import (
FaceMap,
add_faces_to_map,
add_facemap_for_groups
)
from ..utils import (
select,
local_xyz,
bm_to_obj,
crash_safe,
bm_from_obj,
popup_message... | true | true |
f74c418d47b8e59ffac276ccae4f25750744390a | 914 | py | Python | report/client/influx.py | Aaron-DH/openstack_sample_project | 711a56311806d52b632e4394743bd4bdbacb103a | [
"Apache-2.0"
] | null | null | null | report/client/influx.py | Aaron-DH/openstack_sample_project | 711a56311806d52b632e4394743bd4bdbacb103a | [
"Apache-2.0"
] | null | null | null | report/client/influx.py | Aaron-DH/openstack_sample_project | 711a56311806d52b632e4394743bd4bdbacb103a | [
"Apache-2.0"
] | null | null | null |
from influxdb.client import InfluxDBClusterClient
from oslo_config import cfg
from oslo_log import log
LOG = log.getLogger(__name__)
CONF = cfg.CONF
influxdb_opts = {
cfg.StrOpt('influxdb_url',
secret=True,
help='influxdb url'),
}
CONF.register_opts(influxdb_opts, 'influxdb')
c... | 22.292683 | 70 | 0.624726 |
from influxdb.client import InfluxDBClusterClient
from oslo_config import cfg
from oslo_log import log
LOG = log.getLogger(__name__)
CONF = cfg.CONF
influxdb_opts = {
cfg.StrOpt('influxdb_url',
secret=True,
help='influxdb url'),
}
CONF.register_opts(influxdb_opts, 'influxdb')
c... | false | true |
f74c423744df36a1dfe99eccd300e1a0eb73f076 | 11,236 | py | Python | tensorflow_probability/python/internal/backend/numpy/gen/linear_operator_diag.py | bourov/probability | 1e4053a0938b4773c3425bcbb07b3f1e5d50c7e2 | [
"Apache-2.0"
] | 2 | 2020-12-17T20:43:24.000Z | 2021-06-11T22:09:16.000Z | tensorflow_probability/python/internal/backend/numpy/gen/linear_operator_diag.py | bourov/probability | 1e4053a0938b4773c3425bcbb07b3f1e5d50c7e2 | [
"Apache-2.0"
] | null | null | null | tensorflow_probability/python/internal/backend/numpy/gen/linear_operator_diag.py | bourov/probability | 1e4053a0938b4773c3425bcbb07b3f1e5d50c7e2 | [
"Apache-2.0"
] | 1 | 2020-12-19T13:05:15.000Z | 2020-12-19T13:05:15.000Z | # Copyright 2020 The TensorFlow Probability Authors. All Rights Reserved.
# @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
# THIS FILE IS AUTO-GENERATED BY `gen_linear_operators.py`.
# DO NOT MODIFY DIRECTLY.
# @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@... | 38.348123 | 113 | 0.686899 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow_probability.python.internal.backend.numpy import ops
from tensorflow_probability.python.internal.backend.numpy import numpy_array as array_ops
from tensorflow_probability.python.internal.backe... | true | true |
f74c43234a70673612145c4fb39905f4b50c965e | 1,020 | py | Python | scripts/wall_stop.py | kenjiinukai/pimouse_run_corridor | e804855a670d37996695f87cf68630d7c253e57f | [
"BSD-3-Clause"
] | null | null | null | scripts/wall_stop.py | kenjiinukai/pimouse_run_corridor | e804855a670d37996695f87cf68630d7c253e57f | [
"BSD-3-Clause"
] | null | null | null | scripts/wall_stop.py | kenjiinukai/pimouse_run_corridor | e804855a670d37996695f87cf68630d7c253e57f | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
import rospy,copy
from geometry_msgs.msg import Twist
from std_srvs.srv import Trigger, TriggerResponse
from pimouse_ros.msg import LightSensorValues
class WallStop():
def __init__(self):
self.cmd_vel = rospy.Publisher('/cmd_vel',Twist,queue_size=1)
self.sensor_values = Light... | 30 | 76 | 0.682353 | import rospy,copy
from geometry_msgs.msg import Twist
from std_srvs.srv import Trigger, TriggerResponse
from pimouse_ros.msg import LightSensorValues
class WallStop():
def __init__(self):
self.cmd_vel = rospy.Publisher('/cmd_vel',Twist,queue_size=1)
self.sensor_values = LightSensorValues()
... | true | true |
f74c45338b176be5241745fac27a1e2f4ffa92ee | 47,311 | py | Python | mce.py | eric-wieser/pymclevel | 253597f0f2037d720751b90a025af0830ae8559c | [
"0BSD"
] | 1 | 2021-08-30T20:02:51.000Z | 2021-08-30T20:02:51.000Z | mce.py | eric-wieser/pymclevel | 253597f0f2037d720751b90a025af0830ae8559c | [
"0BSD"
] | null | null | null | mce.py | eric-wieser/pymclevel | 253597f0f2037d720751b90a025af0830ae8559c | [
"0BSD"
] | null | null | null | #!/usr/bin/env python
import mclevel
import infiniteworld
import sys
import os
from box import BoundingBox
import numpy
from numpy import zeros, bincount
import logging
import itertools
import traceback
import shlex
import operator
import codecs
from math import floor
try:
import readline # if available, used by ... | 31.498668 | 127 | 0.536936 | import mclevel
import infiniteworld
import sys
import os
from box import BoundingBox
import numpy
from numpy import zeros, bincount
import logging
import itertools
import traceback
import shlex
import operator
import codecs
from math import floor
try:
import readline except:
pass
class UsageError(RuntimeErr... | false | true |
f74c45fd6ffae380f1dbf7e897526bbade6a2a0f | 389 | py | Python | Blog_Website/BlogApp/migrations/0006_alter_blogpost_image.py | MetinIlgar/BlogWebsite | 014ae848dbed2d42c86654f0fbdb4450ccd9ef00 | [
"MIT"
] | 1 | 2022-02-25T10:16:04.000Z | 2022-02-25T10:16:04.000Z | Blog_Website/BlogApp/migrations/0006_alter_blogpost_image.py | MetinIlgar/BlogWebsite | 014ae848dbed2d42c86654f0fbdb4450ccd9ef00 | [
"MIT"
] | null | null | null | Blog_Website/BlogApp/migrations/0006_alter_blogpost_image.py | MetinIlgar/BlogWebsite | 014ae848dbed2d42c86654f0fbdb4450ccd9ef00 | [
"MIT"
] | null | null | null | # Generated by Django 4.0.3 on 2022-03-06 12:36
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('BlogApp', '0005_alter_blogpost_image'),
]
operations = [
migrations.AlterField(
model_name='blogpost',
name='image',... | 20.473684 | 50 | 0.596401 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('BlogApp', '0005_alter_blogpost_image'),
]
operations = [
migrations.AlterField(
model_name='blogpost',
name='image',
field=models.ImageField(upload_to='... | true | true |
f74c48fe98e8077d82684a4c61e4e4650e5b32b9 | 3,334 | py | Python | tests/_test_pcli.py | Phlya/pysradb | f41c0b2f58ac3ed7dbbdd103f4edc8d30a5fe61d | [
"BSD-3-Clause"
] | null | null | null | tests/_test_pcli.py | Phlya/pysradb | f41c0b2f58ac3ed7dbbdd103f4edc8d30a5fe61d | [
"BSD-3-Clause"
] | null | null | null | tests/_test_pcli.py | Phlya/pysradb | f41c0b2f58ac3ed7dbbdd103f4edc8d30a5fe61d | [
"BSD-3-Clause"
] | null | null | null | """Tests for cli.py
"""
import os
import subprocess
import sys
from shlex import quote
from shlex import split
import pytest
from pysradb import SRAdb
def run(command):
if sys.version_info.minor >= 7:
result = subprocess.run(split(command), capture_output=True)
else:
result = subprocess.run(... | 25.844961 | 93 | 0.673965 |
import os
import subprocess
import sys
from shlex import quote
from shlex import split
import pytest
from pysradb import SRAdb
def run(command):
if sys.version_info.minor >= 7:
result = subprocess.run(split(command), capture_output=True)
else:
result = subprocess.run(split(command), check=Tr... | true | true |
f74c499d0b49afbed9411bf5ad160301a350a8ab | 1,948 | py | Python | local_mysql.py | wjhtime/region_spider | d1828abc52d0a2ba39f48046786f274c053985d8 | [
"MIT"
] | null | null | null | local_mysql.py | wjhtime/region_spider | d1828abc52d0a2ba39f48046786f274c053985d8 | [
"MIT"
] | null | null | null | local_mysql.py | wjhtime/region_spider | d1828abc52d0a2ba39f48046786f274c053985d8 | [
"MIT"
] | null | null | null | import pymysql
from database import db
import asyncio
import aiomysql
class local_mysql():
def __init__(self):
self.host = db['host']
self.user = db['user']
self.password = db['password']
self.database = db['database']
self.db = pymysql.connect(self.host, self.user, self.pa... | 36.074074 | 116 | 0.532341 | import pymysql
from database import db
import asyncio
import aiomysql
class local_mysql():
def __init__(self):
self.host = db['host']
self.user = db['user']
self.password = db['password']
self.database = db['database']
self.db = pymysql.connect(self.host, self.user, self.pa... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.