hexsha stringlengths 40 40 | size int64 1 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 239 | max_stars_repo_name stringlengths 5 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 3 239 | max_issues_repo_name stringlengths 5 130 | max_issues_repo_head_hexsha stringlengths 40 78 | 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 3 239 | max_forks_repo_name stringlengths 5 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 1 1.03M | avg_line_length float64 1 958k | max_line_length int64 1 1.03M | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
794185a23fe0f8cbebee3a61f2f3486d4411e7f5 | 368 | py | Python | env/Lib/site-packages/jsonify/convert.py | iamagoogler/crud_flask | 42280fd33b7c34ee3bb24cf3fe6e0f830a8408ef | [
"MIT"
] | 20 | 2018-05-08T20:41:48.000Z | 2019-08-15T02:15:58.000Z | env/Lib/site-packages/jsonify/convert.py | iamagoogler/crud_flask | 42280fd33b7c34ee3bb24cf3fe6e0f830a8408ef | [
"MIT"
] | 7 | 2018-11-15T17:45:06.000Z | 2018-11-15T17:45:30.000Z | env/Lib/site-packages/jsonify/convert.py | iamagoogler/crud_flask | 42280fd33b7c34ee3bb24cf3fe6e0f830a8408ef | [
"MIT"
] | 5 | 2018-07-03T03:15:01.000Z | 2020-09-10T06:30:27.000Z | #!/usr/bin/python
import csv
import json
def jsonify(csv_name):
with open(csv_name, 'r') as f:
data = []
reader = csv.DictReader(f)
jsonf = open(csv_name[:len(csv_name)-3] + 'json', 'w')
for row in reader:
data.append(row)
jsonf.write(json.dumps(data, sort_keys=... | 23 | 63 | 0.5625 |
794186525f942776c1a1fcc59335efc9bca31ace | 381 | py | Python | taobao-tianmao/top/api/rest/AlibabaWdkMarketingItembuygiftQueryactivityRequest.py | ScottLeeF/python-example | 0b230ba80fe5020d70329a9d73e058013f0ca111 | [
"Apache-2.0"
] | null | null | null | taobao-tianmao/top/api/rest/AlibabaWdkMarketingItembuygiftQueryactivityRequest.py | ScottLeeF/python-example | 0b230ba80fe5020d70329a9d73e058013f0ca111 | [
"Apache-2.0"
] | 7 | 2021-03-19T02:12:42.000Z | 2022-03-12T00:25:28.000Z | taobao-tianmao/top/api/rest/AlibabaWdkMarketingItembuygiftQueryactivityRequest.py | ScottLeeF/python-example | 0b230ba80fe5020d70329a9d73e058013f0ca111 | [
"Apache-2.0"
] | null | null | null | '''
Created by auto_sdk on 2019.04.15
'''
from top.api.base import RestApi
class AlibabaWdkMarketingItembuygiftQueryactivityRequest(RestApi):
def __init__(self, domain='gw.api.taobao.com', port=80):
RestApi.__init__(self, domain, port)
self.param = None
def getapiname(self):
... | 27.214286 | 67 | 0.695538 |
794186b504eb4000bc02a16f76e3f7226d86eaa2 | 2,175 | py | Python | FusionIIIT/applications/research_procedures/views.py | abhishek-geek/Fusion | b4ba6bf3ff1ee836489ed5686855598d1021bbb8 | [
"bzip2-1.0.6"
] | null | null | null | FusionIIIT/applications/research_procedures/views.py | abhishek-geek/Fusion | b4ba6bf3ff1ee836489ed5686855598d1021bbb8 | [
"bzip2-1.0.6"
] | null | null | null | FusionIIIT/applications/research_procedures/views.py | abhishek-geek/Fusion | b4ba6bf3ff1ee836489ed5686855598d1021bbb8 | [
"bzip2-1.0.6"
] | 1 | 2021-09-13T04:39:49.000Z | 2021-09-13T04:39:49.000Z | from django.shortcuts import render,HttpResponse
from django.contrib import messages
from applications.research_procedures.models import Patent
from applications.academic_information.models import Student
from applications.globals.models import ExtraInfo, HoldsDesignation, Designation
from django.contrib.auth.models im... | 36.25 | 99 | 0.663908 |
794186cbe62660c26e4873cb7848a545d309bb44 | 11,459 | py | Python | AFRTest.py | funiuShop/face | 4723c30a785a11c1b197036dc81e0b94c1d70399 | [
"FSFAP"
] | null | null | null | AFRTest.py | funiuShop/face | 4723c30a785a11c1b197036dc81e0b94c1d70399 | [
"FSFAP"
] | null | null | null | AFRTest.py | funiuShop/face | 4723c30a785a11c1b197036dc81e0b94c1d70399 | [
"FSFAP"
] | null | null | null | # coding=utf-8
from arcsoft import CLibrary, ASVL_COLOR_FORMAT, ASVLOFFSCREEN, c_ubyte_p, FaceInfo
from arcsoft.utils import BufferInfo, ImageLoader
from arcsoft.AFD_FSDKLibrary import *
from arcsoft.AFR_FSDKLibrary import *
from ctypes import *
import traceback
APPID = c_char_p(b'xTaxfVjCxaLESdmx2czqfa6hK4YEwzmJLDo7... | 35.042813 | 83 | 0.659831 |
7941872c0c3d8883ecfbf515734810dddccdcab0 | 871 | py | Python | EventFilter/L1TRawToDigi/python/gtStage2Raw_cfi.py | SWuchterl/cmssw | 769b4a7ef81796579af7d626da6039dfa0347b8e | [
"Apache-2.0"
] | 6 | 2017-09-08T14:12:56.000Z | 2022-03-09T23:57:01.000Z | EventFilter/L1TRawToDigi/python/gtStage2Raw_cfi.py | SWuchterl/cmssw | 769b4a7ef81796579af7d626da6039dfa0347b8e | [
"Apache-2.0"
] | 545 | 2017-09-19T17:10:19.000Z | 2022-03-07T16:55:27.000Z | EventFilter/L1TRawToDigi/python/gtStage2Raw_cfi.py | SWuchterl/cmssw | 769b4a7ef81796579af7d626da6039dfa0347b8e | [
"Apache-2.0"
] | 14 | 2017-10-04T09:47:21.000Z | 2019-10-23T18:04:45.000Z | import FWCore.ParameterSet.Config as cms
gtStage2Raw = cms.EDProducer(
"L1TDigiToRaw",
Setup = cms.string("stage2::GTSetup"),
# TowerInputLabel = cms.InputTag("simCaloStage2Digis"),
GtInputTag = cms.InputTag("simGtStage2Digis"),
ExtInputTag = cms.InputTag("simGtExtFakeStage2Digis"),
MuonInputTag... | 43.55 | 84 | 0.717566 |
7941878985381ba4a5569e2f38f02db5106607f3 | 867 | py | Python | scripts/stf/translated_values.py | SFDO-Alliances/NPSP | 3711a3cf8e3124bc2d7e61644d6abecb4042004e | [
"BSD-3-Clause"
] | 413 | 2015-01-02T09:53:04.000Z | 2019-12-05T15:31:25.000Z | scripts/stf/translated_values.py | SFDO-Alliances/NPSP | 3711a3cf8e3124bc2d7e61644d6abecb4042004e | [
"BSD-3-Clause"
] | 2,471 | 2015-01-02T03:33:55.000Z | 2019-12-13T17:55:10.000Z | scripts/stf/translated_values.py | SFDO-Alliances/NPSP | 3711a3cf8e3124bc2d7e61644d6abecb4042004e | [
"BSD-3-Clause"
] | 296 | 2015-01-06T13:03:33.000Z | 2019-12-11T14:19:31.000Z | #!/usr/bin/env python
from sys import argv, stdin, stdout, stderr
TRANSLATED_MARKER = '------------------TRANSLATED-------------------'
UNTRANSLATED_MARKER = '------------------UNTRANSLATED-----------------'
lines_emitted = 0
in_translated_section = False
for line in stdin:
sline = line.strip()
if not sline:... | 24.771429 | 71 | 0.592849 |
794188b8aa11af024e41ee937d7af88c41ea3b97 | 715 | py | Python | appengine/standard/memcache/best_practices/migration_step1/migration1_test.py | ammumaddy/sample | 3be22b92919af3d08584ee0cb849a356f63e602b | [
"Apache-2.0"
] | 1 | 2018-09-24T04:54:26.000Z | 2018-09-24T04:54:26.000Z | appengine/standard/memcache/best_practices/migration_step1/migration1_test.py | DalavanCloud/python-docs-samples | 439ca4c552940284743f5f22a590cc4b6dae1bef | [
"Apache-2.0"
] | 2 | 2021-06-10T23:54:32.000Z | 2021-06-10T23:54:33.000Z | appengine/standard/memcache/best_practices/migration_step1/migration1_test.py | DalavanCloud/python-docs-samples | 439ca4c552940284743f5f22a590cc4b6dae1bef | [
"Apache-2.0"
] | 1 | 2018-09-24T04:53:12.000Z | 2018-09-24T04:53:12.000Z | # Copyright 2016 Google 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-2.0
#
# Unless required by applicable law or a... | 31.086957 | 74 | 0.752448 |
794188d19bba0d4175e1faaeb0fce24e1c4deb32 | 1,267 | py | Python | mabel/utils/text.py | mabel-dev/mabel | 4b06e9e5ce108e8a3267e44685fd61fc9802eb0a | [
"Apache-2.0"
] | null | null | null | mabel/utils/text.py | mabel-dev/mabel | 4b06e9e5ce108e8a3267e44685fd61fc9802eb0a | [
"Apache-2.0"
] | 287 | 2021-05-14T21:25:26.000Z | 2022-03-30T12:02:51.000Z | mabel/utils/text.py | mabel-dev/mabel | 4b06e9e5ce108e8a3267e44685fd61fc9802eb0a | [
"Apache-2.0"
] | null | null | null | import re
import string
from functools import lru_cache
VALID_CHARACTERS = string.ascii_letters + string.digits + string.whitespace
REGEX_CHARACTERS = {ch: "\\" + ch for ch in ".^$*+?{}[]|()\\"}
def tokenize(text):
text = text.lower()
text = "".join([c for c in text if c in VALID_CHARACTERS])
return text... | 24.365385 | 86 | 0.661405 |
79418a0f9d646b4ec22a628bc8a3b7d43a8c764a | 952 | py | Python | setup.py | donavanyieh/hi-kyong | f76153d6a92e6af795f79059f09129f0bc026959 | [
"MIT"
] | null | null | null | setup.py | donavanyieh/hi-kyong | f76153d6a92e6af795f79059f09129f0bc026959 | [
"MIT"
] | null | null | null | setup.py | donavanyieh/hi-kyong | f76153d6a92e6af795f79059f09129f0bc026959 | [
"MIT"
] | null | null | null | from setuptools import setup, find_packages
VERSION = '0.0.1'
DESCRIPTION = 'Hi Kyong!'
LONG_DESCRIPTION = 'A pythonic way to say hi to our prof, prof Kyong. Inspired by https://github.com/tsivinsky/hi-mom.'
# Setting up
setup(
# the name must match the folder name 'verysimplemodule'
name="hikyong",
... | 34 | 119 | 0.60084 |
79418b170a7568cf4af71e22615733d5aeb1e9a7 | 11,510 | py | Python | REDSI_1160929_1161573/boost_1_67_0/tools/build/src/contrib/boost.py | Wultyc/ISEP_1718_2A2S_REDSI_TrabalhoGrupo | eb0f7ef64e188fe871f47c2ef9cdef36d8a66bc8 | [
"MIT"
] | 1 | 2018-12-15T19:57:24.000Z | 2018-12-15T19:57:24.000Z | REDSI_1160929_1161573/boost_1_67_0/tools/build/src/contrib/boost.py | Wultyc/ISEP_1718_2A2S_REDSI_TrabalhoGrupo | eb0f7ef64e188fe871f47c2ef9cdef36d8a66bc8 | [
"MIT"
] | null | null | null | REDSI_1160929_1161573/boost_1_67_0/tools/build/src/contrib/boost.py | Wultyc/ISEP_1718_2A2S_REDSI_TrabalhoGrupo | eb0f7ef64e188fe871f47c2ef9cdef36d8a66bc8 | [
"MIT"
] | 1 | 2019-03-08T11:06:22.000Z | 2019-03-08T11:06:22.000Z | # $Id: boost.jam 62249 2010-05-26 19:05:19Z steven_watanabe $
# Copyright 2008 Roland Schwarz
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
# Boost library support module.
#
# This module allows to use the boost lib... | 40.960854 | 134 | 0.624674 |
79418b267eb3bfe8f8b125ed0b0dd52429cb3133 | 4,836 | py | Python | launchsalsa.py | Uberroot/launchsalsa | ec26cbffd5ab078e9916baf891f5eb1f44ba2d12 | [
"BSD-2-Clause"
] | 1 | 2016-05-05T19:47:59.000Z | 2016-05-05T19:47:59.000Z | launchsalsa.py | Uberroot/launchsalsa | ec26cbffd5ab078e9916baf891f5eb1f44ba2d12 | [
"BSD-2-Clause"
] | null | null | null | launchsalsa.py | Uberroot/launchsalsa | ec26cbffd5ab078e9916baf891f5eb1f44ba2d12 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/python2
#https://pypi.python.org/pypi/alsaseq
import alsaseq
import time
# Button maps - These are the actual MIDI notes
UP = 91
DOWN = 92
LEFT = 93
RIGHT = 94
SESSION = 95
NOTE = 96
DEVICE = 97
USER = 98
SHIFT = 80
CLICK = 70
UNDO = 60
DELETE = 50
QUANTISE = 40
DUPLICATE = 30
DOUBLE = 20
RECORD = 10
AR... | 26.42623 | 90 | 0.525227 |
79418bf7cb38ae8bcd7209e98e2bf559395e8240 | 6,892 | bzl | Python | repo.bzl | dayanruben/android-test | 2ed50d534cb7e48433dcfa5f5e9e793e99506d84 | [
"Apache-2.0"
] | 3 | 2020-09-20T12:29:38.000Z | 2022-03-07T23:48:03.000Z | repo.bzl | dayanruben/android-test | 2ed50d534cb7e48433dcfa5f5e9e793e99506d84 | [
"Apache-2.0"
] | 1 | 2021-03-30T11:26:36.000Z | 2021-03-30T11:26:36.000Z | repo.bzl | dayanruben/android-test | 2ed50d534cb7e48433dcfa5f5e9e793e99506d84 | [
"Apache-2.0"
] | null | null | null | """Skylark rules to setup the WORKSPACE in the opensource bazel world."""
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
# These dependencies are required for *developing* this project.
def _development_repositories():
# Needed by @com_google_protobuf//:protobuf_java_util
native.bind(
... | 40.781065 | 170 | 0.663088 |
79418c7cdc6515a1785dc6ad692082d4329750e8 | 1,858 | py | Python | lib/extra_char_class.py | tylerjereddy/regex-improve | 526ac8ae1bb97bbc5401f3e1796a065ca6d30d98 | [
"MIT"
] | null | null | null | lib/extra_char_class.py | tylerjereddy/regex-improve | 526ac8ae1bb97bbc5401f3e1796a065ca6d30d98 | [
"MIT"
] | 1 | 2020-12-28T23:01:49.000Z | 2020-12-29T15:47:39.000Z | lib/extra_char_class.py | tylerjereddy/regex-improve | 526ac8ae1bb97bbc5401f3e1796a065ca6d30d98 | [
"MIT"
] | null | null | null | """
Regular expressions for policing the inefficient
usage of character classes to hold single
(meta)characters.
This is an efficiency issue noted in Chapter 6 of:
Friedl, Jeffrey. Mastering Regular Expressions. 3rd ed.,
O’Reilly Media, 2009.
See section: 'Don’t use superfluous character classes'
In particular, the... | 37.918367 | 129 | 0.60549 |
79418cd592d702e04f7c4d94e1e7793885e02888 | 1,398 | py | Python | kisti/test/read_json_test.py | listinc/osf.io | b9a0357f3e9b6e905b732e750a16e9452c459d78 | [
"Apache-2.0"
] | null | null | null | kisti/test/read_json_test.py | listinc/osf.io | b9a0357f3e9b6e905b732e750a16e9452c459d78 | [
"Apache-2.0"
] | null | null | null | kisti/test/read_json_test.py | listinc/osf.io | b9a0357f3e9b6e905b732e750a16e9452c459d78 | [
"Apache-2.0"
] | null | null | null | from osf import read_json
def read_kci_paper():
rj = read_json.ReadJson()
data = rj.read_json('json/kci_paper.json')
for i in data:
if i.get('author_main') == '오삼균':
print(i)
def read_author():
rj = read_json.ReadJson()
data = rj.read_json('json/author_email_mapping.json')
... | 22.918033 | 94 | 0.602289 |
79418d7801d2ab381374dba909684e70d2416d6c | 1,023 | py | Python | PythonBasics/Files,Exceptions and functions/exceptionsDemo.py | AnyMoment/PracticePython | 34c1b998a3dd10f3d44650d51a335e350e3e220e | [
"MIT"
] | null | null | null | PythonBasics/Files,Exceptions and functions/exceptionsDemo.py | AnyMoment/PracticePython | 34c1b998a3dd10f3d44650d51a335e350e3e220e | [
"MIT"
] | null | null | null | PythonBasics/Files,Exceptions and functions/exceptionsDemo.py | AnyMoment/PracticePython | 34c1b998a3dd10f3d44650d51a335e350e3e220e | [
"MIT"
] | null | null | null | """
.........................assertions......................
def power(x,y):
assert x>0,"x must be a postive number not {0}"
assert y>0, "y must be a positive non zero number"
return x**y
print(power(1,2))
print(power(1,1))
print(power(1,-1))
....................Exception as arguments
"""
try:
x=int(i... | 22.733333 | 69 | 0.535679 |
79418d99862c520a1d132407b24b742608582828 | 5,811 | py | Python | sdks/python/apache_beam/runners/portability/fn_api_runner_transforms.py | mxm/incubator-beam | a076444706ec8a48e0bd616d234a2a4785233e37 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | sdks/python/apache_beam/runners/portability/fn_api_runner_transforms.py | mxm/incubator-beam | a076444706ec8a48e0bd616d234a2a4785233e37 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | sdks/python/apache_beam/runners/portability/fn_api_runner_transforms.py | mxm/incubator-beam | a076444706ec8a48e0bd616d234a2a4785233e37 | [
"Apache-2.0",
"BSD-3-Clause"
] | 1 | 2019-11-04T11:21:48.000Z | 2019-11-04T11:21:48.000Z | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | 34.182353 | 76 | 0.707623 |
79418f3ef5afee1ba9682defed65d0dfd6063312 | 68 | py | Python | models/tilemap/tiles/ground.py | matumaros/BomberApe | d71616192fd54d9a595261c258e4c7367d2eac5d | [
"Apache-2.0"
] | null | null | null | models/tilemap/tiles/ground.py | matumaros/BomberApe | d71616192fd54d9a595261c258e4c7367d2eac5d | [
"Apache-2.0"
] | null | null | null | models/tilemap/tiles/ground.py | matumaros/BomberApe | d71616192fd54d9a595261c258e4c7367d2eac5d | [
"Apache-2.0"
] | null | null | null |
from .tile import Tile
class Ground(Tile):
LTYPE = 'ground'
| 8.5 | 22 | 0.647059 |
79419035bee43c8ecb7aad2d576044865c496acb | 2,690 | py | Python | google/ads/google_ads/v3/proto/services/product_bidding_category_constant_service_pb2_grpc.py | andy0937/google-ads-python | cb5da7f4a75076828d1fc3524b08cc167670435a | [
"Apache-2.0"
] | 1 | 2019-11-30T23:42:39.000Z | 2019-11-30T23:42:39.000Z | google/ads/google_ads/v3/proto/services/product_bidding_category_constant_service_pb2_grpc.py | andy0937/google-ads-python | cb5da7f4a75076828d1fc3524b08cc167670435a | [
"Apache-2.0"
] | null | null | null | google/ads/google_ads/v3/proto/services/product_bidding_category_constant_service_pb2_grpc.py | andy0937/google-ads-python | cb5da7f4a75076828d1fc3524b08cc167670435a | [
"Apache-2.0"
] | 1 | 2020-03-13T00:14:31.000Z | 2020-03-13T00:14:31.000Z | # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc
from google.ads.google_ads.v3.proto.resources import product_bidding_category_constant_pb2 as google_dot_ads_dot_googleads__v3_dot_proto_dot_resources_dot_product__bidding__category__constant__pb2
from google.ads.google_ads.v3.proto.serv... | 51.730769 | 211 | 0.84461 |
794190a55d8223e75dd9c511f4597edf16942323 | 296 | py | Python | sbirez/migrations/0031_merge.py | kaitlin/afsbirez | 72fd39709adf8ba470151007739cc06e4d3d79dd | [
"CC0-1.0"
] | 8 | 2015-03-30T18:17:28.000Z | 2015-11-19T08:25:56.000Z | sbirez/migrations/0031_merge.py | kaitlin/afsbirez | 72fd39709adf8ba470151007739cc06e4d3d79dd | [
"CC0-1.0"
] | 76 | 2015-01-16T18:23:16.000Z | 2017-07-07T19:36:41.000Z | sbirez/migrations/0031_merge.py | kaitlin/afsbirez | 72fd39709adf8ba470151007739cc06e4d3d79dd | [
"CC0-1.0"
] | 16 | 2015-02-12T20:14:05.000Z | 2021-02-14T11:26:51.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('sbirez', '0030_auto_20150817_1927'),
('sbirez', '0030_element_report_text'),
]
operations = [
]
| 18.5 | 47 | 0.655405 |
79419145e2b7656f5a34b03878a2cc412c4c247b | 436 | py | Python | trip_planner/pages/forms.py | ankurahuja-tech/trip-planner | ed8123e69076efec624908723bae981e3d3fee22 | [
"MIT"
] | 1 | 2021-09-03T09:26:13.000Z | 2021-09-03T09:26:13.000Z | trip_planner/pages/forms.py | ankurahuja-tech/trip-planner | ed8123e69076efec624908723bae981e3d3fee22 | [
"MIT"
] | null | null | null | trip_planner/pages/forms.py | ankurahuja-tech/trip-planner | ed8123e69076efec624908723bae981e3d3fee22 | [
"MIT"
] | null | null | null | from django import forms
from django.forms.widgets import Textarea
class ContactForm(forms.Form):
name = forms.CharField(required=True, max_length=50)
email = forms.EmailField(
required=False, help_text="(optional) Kindly provide your email to allow me to respond to you."
)
subject = forms.Cha... | 36.333333 | 103 | 0.745413 |
7941918cf971abcbaa0d40d15d4d4be58b179ebd | 791 | py | Python | legume/__init__.py | shanham/legume | 859243a5523c6ea89ea2ed7520209c44d6f2dc1c | [
"MIT"
] | null | null | null | legume/__init__.py | shanham/legume | 859243a5523c6ea89ea2ed7520209c44d6f2dc1c | [
"MIT"
] | null | null | null | legume/__init__.py | shanham/legume | 859243a5523c6ea89ea2ed7520209c44d6f2dc1c | [
"MIT"
] | null | null | null | '''
Photonic crystal PWE/GME simulator with autograd support
Monkey-patching numpy/autograd backend inspired by Floris Laporte's FDTD
package at github.com/flaport/fdtd
'''
from .phc import Shape, Circle, Poly, Square, Hexagon, FourierShape
from .phc import PhotCryst, Layer, ShapesLayer, FreeformLayer, Lattice
from . ... | 26.366667 | 72 | 0.65866 |
794191ecfc2ceb867552ea618b60bc4c304a2f7c | 937 | py | Python | caesar cipher/refactoring.py | yeshan333/Cryptography-learning-note | ea32fe95b0e66ce86c5bcebb74cde3ca7a626aee | [
"Apache-2.0"
] | 1 | 2019-12-04T05:03:36.000Z | 2019-12-04T05:03:36.000Z | caesar cipher/refactoring.py | yeshan333/Cryptography-learning-note | ea32fe95b0e66ce86c5bcebb74cde3ca7a626aee | [
"Apache-2.0"
] | null | null | null | caesar cipher/refactoring.py | yeshan333/Cryptography-learning-note | ea32fe95b0e66ce86c5bcebb74cde3ca7a626aee | [
"Apache-2.0"
] | null | null | null | # 优化凯撒加密解密程序结构
LETTERS = ' !"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~'
def caesarCipher(message, mode, key):
translated = ''
global LETTERS
for symbol in message:
if symbol in LETTERS:
num = LETTERS.find(symbol)
... | 26.027778 | 109 | 0.514408 |
7941926954310da6a513c5073f4ee28198ffb11f | 260 | py | Python | ampoule/_version.py | glyph/ampoule | c2f4331f105acfac5869910c487e7e9e92072088 | [
"MIT"
] | 1 | 2017-12-24T22:49:17.000Z | 2017-12-24T22:49:17.000Z | ampoule/_version.py | glyph/ampoule | c2f4331f105acfac5869910c487e7e9e92072088 | [
"MIT"
] | 18 | 2017-12-14T04:04:17.000Z | 2017-12-18T05:56:31.000Z | ampoule/_version.py | glyph/ampoule | c2f4331f105acfac5869910c487e7e9e92072088 | [
"MIT"
] | null | null | null | """
Provides ampoule version information.
"""
# This file is auto-generated! Do not edit!
# Use `python -m incremental.update ampoule` to change this file.
from incremental import Version
__version__ = Version('ampoule', 22, 5, 0)
__all__ = ["__version__"]
| 21.666667 | 65 | 0.730769 |
794192b96e81e383b757044365169028bbaac159 | 3,472 | py | Python | engine/tests/test_collision.py | frlnx/melee | db2670453771c6d3635e97e28bb8667b14643b05 | [
"CC0-1.0"
] | null | null | null | engine/tests/test_collision.py | frlnx/melee | db2670453771c6d3635e97e28bb8667b14643b05 | [
"CC0-1.0"
] | null | null | null | engine/tests/test_collision.py | frlnx/melee | db2670453771c6d3635e97e28bb8667b14643b05 | [
"CC0-1.0"
] | null | null | null | from itertools import chain
import pytest
from engine.models.factories import ShipModelFactory, AsteroidModelFactory
from engine.physics.line import Line
factory = ShipModelFactory()
amf = AsteroidModelFactory()
class TestLine(object):
def setup(self):
self.target = Line([(0, 0), (10, 10)])
def t... | 35.428571 | 101 | 0.658986 |
7941940ab5e56c01b74206b466d1710132236112 | 1,642 | py | Python | accounts/migrations/0006_auto_20210813_1713.py | AungKMin/network-manager | 0db8234a8534731aa3cd0b9001c91ec390704103 | [
"MIT"
] | null | null | null | accounts/migrations/0006_auto_20210813_1713.py | AungKMin/network-manager | 0db8234a8534731aa3cd0b9001c91ec390704103 | [
"MIT"
] | null | null | null | accounts/migrations/0006_auto_20210813_1713.py | AungKMin/network-manager | 0db8234a8534731aa3cd0b9001c91ec390704103 | [
"MIT"
] | null | null | null | # Generated by Django 3.2.6 on 2021-08-13 21:13
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('accounts', '0005_auto_20210813_1623'),
]
operations = [
migrations.RenameModel(
old_name='Tag',
new_name='ContactTag... | 30.981132 | 75 | 0.573691 |
794194f2c79b24c5d5b4b7656ffcc7d8e13dbdbb | 6,823 | py | Python | djf_surveys/summary.py | irfanpule/django-form-surveys | ae27133f040e4bdf40c02944c6d5af65562b216d | [
"MIT"
] | 5 | 2022-03-22T08:10:07.000Z | 2022-03-30T11:52:01.000Z | djf_surveys/summary.py | irfanpule/django-form-surveys | ae27133f040e4bdf40c02944c6d5af65562b216d | [
"MIT"
] | 1 | 2022-03-14T08:49:49.000Z | 2022-03-14T09:40:10.000Z | djf_surveys/summary.py | irfanpule/django-form-surveys | ae27133f040e4bdf40c02944c6d5af65562b216d | [
"MIT"
] | null | null | null | import random
from djf_surveys.models import TYPE_FIELD, Survey, Question, Answer
from djf_surveys.utils import create_star
COLORS = [
'#64748b', '#a1a1aa', '#374151', '#78716c', '#d6d3d1', '#fca5a5', '#ef4444', '#7f1d1d',
'#fb923c', '#c2410c', '#fcd34d', '#b45309', '#fde047', '#bef264', '#ca8a04', '#65a30d',
'... | 28.429167 | 114 | 0.597098 |
794195ad453e2a64801477d103e7c94551cd6269 | 853 | py | Python | tutorials/load_saved_model/tutorial_two.py | wangsd01/blackbox_mpc | 7876dee1bd85bde310e88741f5c63e3f7bd93916 | [
"MIT"
] | 29 | 2020-10-20T08:14:45.000Z | 2022-02-01T13:43:13.000Z | tutorials/load_saved_model/tutorial_two.py | wangsd01/blackbox_mpc | 7876dee1bd85bde310e88741f5c63e3f7bd93916 | [
"MIT"
] | 3 | 2020-11-27T13:25:08.000Z | 2021-12-12T04:30:41.000Z | tutorials/load_saved_model/tutorial_two.py | wangsd01/blackbox_mpc | 7876dee1bd85bde310e88741f5c63e3f7bd93916 | [
"MIT"
] | 3 | 2021-04-15T14:23:41.000Z | 2022-03-28T05:43:29.000Z | """
- instantiate an env for a pendulum
- instantiate an MPC by loading a previosuluy saved dynamics model.
- render the result.
"""
from blackbox_mpc.policies.mpc_policy import \
MPCPolicy
from blackbox_mpc.utils.pendulum import pendulum_reward_function
import gym
env = gym.make("Pendulum-v0")
mpc_policy = MPCPol... | 34.12 | 70 | 0.675264 |
79419790576fe9a11a74643d3848fdff5969b798 | 895 | py | Python | paml/lib/wait.py | palibhasataolamang/paml | f3f2c113f0925e42557820416199bd6eaaeb091c | [
"MIT"
] | null | null | null | paml/lib/wait.py | palibhasataolamang/paml | f3f2c113f0925e42557820416199bd6eaaeb091c | [
"MIT"
] | null | null | null | paml/lib/wait.py | palibhasataolamang/paml | f3f2c113f0925e42557820416199bd6eaaeb091c | [
"MIT"
] | null | null | null | import sbol3
import paml
#############################################
# Set up the document
doc = sbol3.Document()
LIBRARY_NAME = 'wait'
sbol3.set_namespace('https://bioprotocols.org/paml/primitives/'+LIBRARY_NAME)
#############################################
# Create the primitives
print('Making primitives for '+L... | 25.571429 | 77 | 0.669274 |
79419891b3571a08b249daf88c81de1b891026bc | 4,003 | py | Python | alipay/aop/api/request/AlipayMarketingRecruitEnrollCreateRequest.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 213 | 2018-08-27T16:49:32.000Z | 2021-12-29T04:34:12.000Z | alipay/aop/api/request/AlipayMarketingRecruitEnrollCreateRequest.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 29 | 2018-09-29T06:43:00.000Z | 2021-09-02T03:27:32.000Z | alipay/aop/api/request/AlipayMarketingRecruitEnrollCreateRequest.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 59 | 2018-08-27T16:59:26.000Z | 2022-03-25T10:08:15.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.FileItem import FileItem
from alipay.aop.api.constant.ParamConstants import *
from alipay.aop.api.domain.AlipayMarketingRecruitEnrollCreateModel import AlipayMarketingRecruitEnrollCreateModel
class AlipayMarketingRecruitEnrollCreateReque... | 27.606897 | 148 | 0.647514 |
794198d2b5e9614307f9d29fabd371dbfd531ef7 | 6,868 | py | Python | doc/source/conf.py | josephwinston/TileDB | 40ea8ba8354e1a8e5af904dfa641468643bee949 | [
"MIT"
] | 1 | 2020-10-21T08:14:42.000Z | 2020-10-21T08:14:42.000Z | doc/source/conf.py | georgeSkoumas/TileDB | 3b9f88002ef245afb93b041ba3c60188893f34a3 | [
"MIT"
] | null | null | null | doc/source/conf.py | georgeSkoumas/TileDB | 3b9f88002ef245afb93b041ba3c60188893f34a3 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# TileDB documentation build configuration file, created by
# sphinx-quickstart on Mon Feb 5 10:08:37 2018.
#
# -- Imports configuration -------------------------------------------------
import os
import subprocess
import sys
from os.path import abspath, join, dirname... | 31.504587 | 120 | 0.656814 |
79419c6c06be5a9c87a9d0d4b892c5a7dc6bb7f9 | 3,837 | py | Python | bsp/stm32/stm32f429-armfly-v6/rtconfig.py | Tigerots/rt-thread | c95987e75772ebc6a6fdd0c19d12001aef810cb2 | [
"Apache-2.0"
] | 3 | 2021-01-27T09:03:43.000Z | 2021-04-25T18:20:32.000Z | bsp/stm32/stm32f429-armfly-v6/rtconfig.py | zlzerg/rt-thread | c0a400ccbee720fc0e9ee904298f09bd07a21382 | [
"Apache-2.0"
] | 2 | 2019-09-23T01:59:04.000Z | 2019-12-06T01:24:37.000Z | bsp/stm32/stm32f429-armfly-v6/rtconfig.py | zlzerg/rt-thread | c0a400ccbee720fc0e9ee904298f09bd07a21382 | [
"Apache-2.0"
] | 7 | 2019-07-01T02:50:47.000Z | 2020-12-11T10:01:07.000Z | import os
# toolchains options
ARCH='arm'
CPU='cortex-m4'
CROSS_TOOL='gcc'
# bsp lib config
BSP_LIBRARY_TYPE = None
if os.getenv('RTT_CC'):
CROSS_TOOL = os.getenv('RTT_CC')
if os.getenv('RTT_ROOT'):
RTT_ROOT = os.getenv('RTT_ROOT')
# cross_tool provides the cross compiler
# EXEC_PATH is the compiler execute... | 26.462069 | 152 | 0.572583 |
79419db959e4c2008138b1e4cf10be3492ddf832 | 1,713 | py | Python | tests/write_for_externals.py | hlibbabii/log-recommender | 03c975da4029676acb2c29f5915e30b2b29fce6c | [
"MIT"
] | 2 | 2019-04-02T13:46:55.000Z | 2022-03-18T02:33:51.000Z | tests/write_for_externals.py | hlibbabii/log-recommender | 03c975da4029676acb2c29f5915e30b2b29fce6c | [
"MIT"
] | 119 | 2018-09-10T13:45:41.000Z | 2022-03-11T23:55:07.000Z | tests/write_for_externals.py | hlibbabii/log-recommender | 03c975da4029676acb2c29f5915e30b2b29fce6c | [
"MIT"
] | 1 | 2019-04-02T14:29:24.000Z | 2019-04-02T14:29:24.000Z | from logrec.dataprep.preprocessors import apply_preprocessors
from logrec.dataprep.preprocessors.preprocessor_list import pp_params
from logrec.dataprep.preprocessors.general import from_file
__author__ = 'hlib'
import unittest
class PreprocessTest(unittest.TestCase):
@unittest.skip("outdated") # TODO update!!... | 47.583333 | 592 | 0.705196 |
79419ec116e9b4ea4d4a076b505fc930917979be | 1,524 | py | Python | fbpmp/pid/service/credential_service/session_profile_cloud_credential_service.py | benliugithub/fbpcs | 7af984264428058645847135026d474d7e28144e | [
"MIT"
] | null | null | null | fbpmp/pid/service/credential_service/session_profile_cloud_credential_service.py | benliugithub/fbpcs | 7af984264428058645847135026d474d7e28144e | [
"MIT"
] | null | null | null | fbpmp/pid/service/credential_service/session_profile_cloud_credential_service.py | benliugithub/fbpcs | 7af984264428058645847135026d474d7e28144e | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# 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 ast
import os
import pathlib
import subprocess
import sys
from typing import Dict
from fbpmp.pid.service.creden... | 35.44186 | 136 | 0.679134 |
79419ecdbcfd8d0fd1eaa8237e1290aa3a1e6610 | 5,279 | py | Python | hphp/hack/test/hh_codesynthesis/cross_verify.py | leikahing/hhvm | 26617c88ca35c5e078c3aef12c061d7996925375 | [
"PHP-3.01",
"Zend-2.0"
] | null | null | null | hphp/hack/test/hh_codesynthesis/cross_verify.py | leikahing/hhvm | 26617c88ca35c5e078c3aef12c061d7996925375 | [
"PHP-3.01",
"Zend-2.0"
] | null | null | null | hphp/hack/test/hh_codesynthesis/cross_verify.py | leikahing/hhvm | 26617c88ca35c5e078c3aef12c061d7996925375 | [
"PHP-3.01",
"Zend-2.0"
] | null | null | null | #!/usr/bin/env/python3
# pyre-strict
import argparse
import glob
import os
import subprocess
import tempfile
from typing import Dict, List, Set
class DependencyEdges(object):
"""A simple internal representation to categorize DependencyEdges"""
edge_types = ["Extends", "Type", "Method", "SMethod", "Fun"]
... | 33.411392 | 85 | 0.606744 |
79419ee58c41cb26176b5cac8c566f179301ee34 | 4,945 | py | Python | lib/flask_api/tests/test_renderers.py | imtiaz-emu/gcp-flask-test | 096f466242aa14941712ab8ea06ac4fb4eaeb993 | [
"Apache-2.0"
] | null | null | null | lib/flask_api/tests/test_renderers.py | imtiaz-emu/gcp-flask-test | 096f466242aa14941712ab8ea06ac4fb4eaeb993 | [
"Apache-2.0"
] | null | null | null | lib/flask_api/tests/test_renderers.py | imtiaz-emu/gcp-flask-test | 096f466242aa14941712ab8ea06ac4fb4eaeb993 | [
"Apache-2.0"
] | null | null | null | # coding: utf8
from __future__ import unicode_literals
from flask_api import renderers, status, FlaskAPI
from flask_api.decorators import set_renderers
from flask_api.mediatypes import MediaType
import unittest
class RendererTests(unittest.TestCase):
def test_render_json(self):
renderer = renderers.JSONRe... | 40.532787 | 98 | 0.621436 |
79419f02caaf1ddb43da666e199368f7b8855af7 | 1,135 | py | Python | blog/2019-09-29/main.py | wrn14897/myBlog | 003db7c050456bf9690847a98fb513f453a2debb | [
"MIT"
] | null | null | null | blog/2019-09-29/main.py | wrn14897/myBlog | 003db7c050456bf9690847a98fb513f453a2debb | [
"MIT"
] | 9 | 2020-03-05T07:29:04.000Z | 2022-02-27T22:34:44.000Z | blog/2019-09-29/main.py | wrn14897/myBlog | 003db7c050456bf9690847a98fb513f453a2debb | [
"MIT"
] | null | null | null | import sys
import argparse
from requests_futures.sessions import FuturesSession
def pre_response_hook(n):
def response_hook(resp, *args, **kwargs):
print('Got response from %sth request' % n)
return response_hook
def main():
parser = argparse.ArgumentParser(description='Extremely simple DoS program')
pars... | 32.428571 | 78 | 0.689868 |
79419f1f0594ed58873af99a204a00242fe89850 | 2,854 | py | Python | Challenge2/geru_quotes/geru_quotes/views/quotes.py | zeciola/geru_challege | f4bb64e7c640bd707b1dc08239b68730358ed7c7 | [
"MIT"
] | null | null | null | Challenge2/geru_quotes/geru_quotes/views/quotes.py | zeciola/geru_challege | f4bb64e7c640bd707b1dc08239b68730358ed7c7 | [
"MIT"
] | 3 | 2019-12-26T17:31:51.000Z | 2022-03-21T22:17:41.000Z | Challenge2/geru_quotes/geru_quotes/views/quotes.py | zeciola/geru_challege | f4bb64e7c640bd707b1dc08239b68730358ed7c7 | [
"MIT"
] | null | null | null | from dataclasses import dataclass
from datetime import datetime
from geru_quotes.models import UserSession
from geru_quotes.utils.quotes_api_lib import Quote
from pyramid.request import Request
from pyramid.view import view_config, view_defaults
from random import randrange
from requests import Session
@view_config(r... | 26.425926 | 74 | 0.642957 |
7941a088092384124b8e8df8eb7605f4c748ca5a | 1,113 | py | Python | account/forms.py | irzaip/digiwakaf.id | 4b9a476f3079cdef0733e24da212d5d2c314fe7f | [
"MIT"
] | 1 | 2020-11-21T04:25:04.000Z | 2020-11-21T04:25:04.000Z | account/forms.py | irzaip/digiwakaf.id | 4b9a476f3079cdef0733e24da212d5d2c314fe7f | [
"MIT"
] | null | null | null | account/forms.py | irzaip/digiwakaf.id | 4b9a476f3079cdef0733e24da212d5d2c314fe7f | [
"MIT"
] | null | null | null | from django.forms import ModelForm
from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth.models import User
from .models import Customer, Asset
from django import forms
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Submit
class CreateUserForm(UserCreationForm):
... | 31.8 | 90 | 0.639712 |
7941a0b188d37649d5fcccddaa019ac4d29d00c2 | 1,249 | py | Python | test/test_result_top_files.py | Atomicology/isilon_sdk_python | 91039da803ae37ed4abf8d2a3f59c333f3ef1866 | [
"MIT"
] | null | null | null | test/test_result_top_files.py | Atomicology/isilon_sdk_python | 91039da803ae37ed4abf8d2a3f59c333f3ef1866 | [
"MIT"
] | null | null | null | test/test_result_top_files.py | Atomicology/isilon_sdk_python | 91039da803ae37ed4abf8d2a3f59c333f3ef1866 | [
"MIT"
] | null | null | null | # coding: utf-8
"""
Copyright 2016 SmartBear Software
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 l... | 25.489796 | 75 | 0.730184 |
7941a20ecf7c680b17902328f0e15c4f7e189abc | 1,181 | py | Python | Task2E.py | mb2403/IA_computing_112 | eaa82ae79091b5a3df695878e3d77b2edf13dee9 | [
"MIT"
] | null | null | null | Task2E.py | mb2403/IA_computing_112 | eaa82ae79091b5a3df695878e3d77b2edf13dee9 | [
"MIT"
] | null | null | null | Task2E.py | mb2403/IA_computing_112 | eaa82ae79091b5a3df695878e3d77b2edf13dee9 | [
"MIT"
] | 1 | 2022-01-20T16:53:57.000Z | 2022-01-20T16:53:57.000Z | # Max Bowler/Lewis Clark Jan/Feb 2022
# Task 2E
#
#%%
import datetime
from floodsystem.datafetcher import fetch_measure_levels
from floodsystem.analysis import polyfit
from floodsystem.plot import plot_water_levels
from floodsystem.stationdata import build_station_list, update_water_levels
from floodsystem.flood import... | 38.096774 | 142 | 0.69348 |
7941a273f5e7cf5c2e73d5d5a71e2680916f0456 | 1,451 | py | Python | python3/plesk_api_client.py | JhonathanH/api-plesk | 865ae38a87b20a556cca8f4eea03cc0244acca91 | [
"Apache-2.0"
] | 75 | 2015-01-06T13:29:43.000Z | 2021-11-21T19:57:07.000Z | python3/plesk_api_client.py | JhonathanH/api-plesk | 865ae38a87b20a556cca8f4eea03cc0244acca91 | [
"Apache-2.0"
] | 4 | 2015-06-01T06:53:19.000Z | 2020-03-18T13:27:36.000Z | python3/plesk_api_client.py | JhonathanH/api-plesk | 865ae38a87b20a556cca8f4eea03cc0244acca91 | [
"Apache-2.0"
] | 61 | 2015-01-22T16:20:33.000Z | 2021-08-10T11:55:59.000Z | # Copyright 1999-2016. Parallels IP Holdings GmbH. All Rights Reserved.
import http.client
import ssl
class PleskApiClient:
def __init__(self, host, port = 8443, protocol = 'https', ssl_unverified = False):
self.host = host
self.port = port
self.protocol = protocol
self.secret_key... | 32.244444 | 114 | 0.619573 |
7941a29531246e3ae14311d065277d6a6b5dd9f5 | 307 | py | Python | Image_Processing/webcam.py | VDHARV/self-driving-car-rasberrypi | 45e70ce97f00471d38aca87dc94dbae032823f24 | [
"MIT"
] | null | null | null | Image_Processing/webcam.py | VDHARV/self-driving-car-rasberrypi | 45e70ce97f00471d38aca87dc94dbae032823f24 | [
"MIT"
] | null | null | null | Image_Processing/webcam.py | VDHARV/self-driving-car-rasberrypi | 45e70ce97f00471d38aca87dc94dbae032823f24 | [
"MIT"
] | null | null | null | import cv2
cap = cv2.VideoCapture(0)
def getImg(display = False, size = [480, 240]):
_, img = cap.read()
img = cv2.resize(img, (size[0], size[1]))
if display:
cv2.imshow("Img", img)
return img
if __name__ == "__main__":
while True:
img = getImg(True)
| 19.1875 | 47 | 0.547231 |
7941a4034be8a6ac009c5b4caf27cfa9b641e5bc | 10,775 | py | Python | back-end/threats_monitoring/phishtank_summer.py | tzamalisp/saint-open-source-tool-for-cyberthreats-monitoring | c30e6da5358555d06413541b6d3893c62a475368 | [
"MIT"
] | null | null | null | back-end/threats_monitoring/phishtank_summer.py | tzamalisp/saint-open-source-tool-for-cyberthreats-monitoring | c30e6da5358555d06413541b6d3893c62a475368 | [
"MIT"
] | null | null | null | back-end/threats_monitoring/phishtank_summer.py | tzamalisp/saint-open-source-tool-for-cyberthreats-monitoring | c30e6da5358555d06413541b6d3893c62a475368 | [
"MIT"
] | null | null | null | import time
from datetime import datetime
import itertools
from pymongo import MongoClient
from downloader import Downloader
from descriptive_analysis import DescriptiveAnalysis
from export_collection_data import ExportCollectionData
# scraping libraries
from bs4 import BeautifulSoup
from lxml.html import from... | 35.212418 | 121 | 0.507749 |
7941a5e2b49846a8fceb352fb67332866b029456 | 2,905 | py | Python | airflow/contrib/operators/file_to_gcs.py | shuva10v/airflow | a6daeb544e815fe350a96d24ae3bb14aee4079a7 | [
"Apache-2.0"
] | 3 | 2019-10-03T21:38:59.000Z | 2019-10-04T00:39:03.000Z | airflow/contrib/operators/file_to_gcs.py | shuva10v/airflow | a6daeb544e815fe350a96d24ae3bb14aee4079a7 | [
"Apache-2.0"
] | 7 | 2019-03-27T07:58:14.000Z | 2020-02-12T17:42:33.000Z | airflow/contrib/operators/file_to_gcs.py | upjohnc/airflow-upjohn-k8s | caadbc1618d73e054de99138b0892cea3a9327c4 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 5 | 2017-06-19T19:55:47.000Z | 2020-10-10T00:49:20.000Z | # -*- coding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
#... | 35 | 81 | 0.66747 |
7941a6f6deced3c613dbbc7d9731acd582d448c1 | 2,503 | py | Python | main.py | eduardorezaghi/jogo-da-velha-fatec | 6068c4c9e55a120b90397ecdba78e3d3764e285b | [
"MIT"
] | null | null | null | main.py | eduardorezaghi/jogo-da-velha-fatec | 6068c4c9e55a120b90397ecdba78e3d3764e285b | [
"MIT"
] | null | null | null | main.py | eduardorezaghi/jogo-da-velha-fatec | 6068c4c9e55a120b90397ecdba78e3d3764e285b | [
"MIT"
] | null | null | null | tabuleiro = [' ', ' ', ' ',
' ', ' ', ' ',
' ', ' ', ' '
]
def coordenada_esta_no_limite(c, texto):
while (c < 0) or (c > 2):
c = int(input('Digite o valor da '+ str(texto) + ': ' ))
return c
def entrada_do_usuario(): # Esta função representa a entrada do usuário.
... | 27.811111 | 124 | 0.63324 |
7941a7a7cebe0697e0855f63e2064087cd758fc8 | 700 | py | Python | python/image_moderation_batch_aksk_demo.py | MeekoI/ais-sdk | 76240abc49795e914988f3cafb6d08f60dbdcb4c | [
"Apache-2.0"
] | null | null | null | python/image_moderation_batch_aksk_demo.py | MeekoI/ais-sdk | 76240abc49795e914988f3cafb6d08f60dbdcb4c | [
"Apache-2.0"
] | null | null | null | python/image_moderation_batch_aksk_demo.py | MeekoI/ais-sdk | 76240abc49795e914988f3cafb6d08f60dbdcb4c | [
"Apache-2.0"
] | null | null | null | # -*- coding:utf-8 -*-
from ais_sdk.image_moderation_batch import image_content_batch_aksk
from ais_sdk.utils import init_global_env
if __name__ == '__main__':
#
# access moderation image of batch jobs,post data by ak,sk
#
app_key = '*************'
app_secret = '************'
init_global_env(re... | 36.842105 | 121 | 0.695714 |
7941a8963b1ab448f1899f6e79af1c1227f0a562 | 1,705 | py | Python | mayan/apps/dynamic_search/api_views.py | garrans/mayan-edms | e95e90cc47447a1ae72629271652824aa9868572 | [
"Apache-2.0"
] | 1 | 2020-07-15T02:56:02.000Z | 2020-07-15T02:56:02.000Z | mayan/apps/dynamic_search/api_views.py | kyper999/mayan-edms | ca7b8301a1f68548e8e718d42a728a500d67286e | [
"Apache-2.0"
] | null | null | null | mayan/apps/dynamic_search/api_views.py | kyper999/mayan-edms | ca7b8301a1f68548e8e718d42a728a500d67286e | [
"Apache-2.0"
] | 2 | 2020-02-24T21:02:31.000Z | 2021-01-05T23:52:01.000Z | from __future__ import unicode_literals
from rest_framework import generics
from rest_framework.exceptions import ParseError
from rest_api.filters import MayanObjectPermissionsFilter
from .classes import SearchModel
from .filters import RecentSearchUserFilter
from .models import RecentSearch
from .serializers import... | 27.95082 | 79 | 0.72434 |
7941a931c9c3e300e63733ef472a965cc488d5fe | 5,862 | py | Python | sdk/python/pulumi_azure_native/botservice/list_bot_connection_with_secrets.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/botservice/list_bot_connection_with_secrets.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/botservice/list_bot_connection_with_secrets.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities
from... | 33.497143 | 158 | 0.623166 |
7941a978116e90e542d0d8ea22dfb4dbb7514103 | 3,118 | py | Python | src/primaires/scripting/commandes/scripting/alerte_liste.py | stormi/tsunami | bdc853229834b52b2ee8ed54a3161a1a3133d926 | [
"BSD-3-Clause"
] | null | null | null | src/primaires/scripting/commandes/scripting/alerte_liste.py | stormi/tsunami | bdc853229834b52b2ee8ed54a3161a1a3133d926 | [
"BSD-3-Clause"
] | null | null | null | src/primaires/scripting/commandes/scripting/alerte_liste.py | stormi/tsunami | bdc853229834b52b2ee8ed54a3161a1a3133d926 | [
"BSD-3-Clause"
] | null | null | null | # -*-coding:Utf-8 -*
# Copyright (c) 2010 LE GOFF Vincent
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# lis... | 43.915493 | 79 | 0.680564 |
7941a9e9dcc0a9dcf2e6950ae2d1b157894063ce | 591 | py | Python | domain/preprocessing/preprocessor.py | nazarimilad/open-intelligence-backend | 9b38db0f52ce78abeb83601f05d1987ad6a2b0e8 | [
"MIT"
] | 39 | 2020-07-01T03:00:49.000Z | 2022-02-17T07:39:49.000Z | domain/preprocessing/preprocessor.py | nazarimilad/open-intelligence-backend | 9b38db0f52ce78abeb83601f05d1987ad6a2b0e8 | [
"MIT"
] | 2 | 2020-08-12T04:31:10.000Z | 2020-09-09T14:27:27.000Z | domain/preprocessing/preprocessor.py | nazarimilad/open-intelligence-backend | 9b38db0f52ce78abeb83601f05d1987ad6a2b0e8 | [
"MIT"
] | 5 | 2020-11-16T09:45:16.000Z | 2022-02-17T07:39:51.000Z | import cv2
import numpy as np
def _add_padding(bordersize, image):
row, col = image.shape[:2]
bottom = image[row-2:row, 0:col]
mean = cv2.mean(bottom)[0]
return cv2.copyMakeBorder(
image,
top=bordersize,
bottom=bordersize,
left=bordersize,
right=bordersize,
... | 26.863636 | 61 | 0.658206 |
7941a9ea3dfaa17a98e91aee37b2af429e186f7b | 1,044 | py | Python | opmodaq/opmodaq/devices/plot.py | MenloSystems/opMoDAQ | 8e35eeb028ae8001fdbebeeeb95a15b98f0fd4ba | [
"MIT"
] | null | null | null | opmodaq/opmodaq/devices/plot.py | MenloSystems/opMoDAQ | 8e35eeb028ae8001fdbebeeeb95a15b98f0fd4ba | [
"MIT"
] | null | null | null | opmodaq/opmodaq/devices/plot.py | MenloSystems/opMoDAQ | 8e35eeb028ae8001fdbebeeeb95a15b98f0fd4ba | [
"MIT"
] | null | null | null | # Windows DAQ device interface
import opmodaq.device as dev
import opmodaq.parameters as params
import opmodaq.generators as gen
import matplotlib.pyplot as plt
class PlotDeviceChannel(dev.Channel):
def __init__(self, device, channel_idx):
dev.Channel.__init__(self, device, channel_idx)
def ... | 26.1 | 71 | 0.648467 |
7941aa5af5462edbfca3d4335f4726f121ab8295 | 10,354 | py | Python | openrave/sandbox/mintime/MintimeProblemGeneric.py | jdsika/TUM_HOly | a2ac55fa1751a3a8038cf61d29b95005f36d6264 | [
"MIT"
] | 2 | 2015-11-13T16:40:57.000Z | 2017-09-15T15:37:19.000Z | openrave/sandbox/mintime/MintimeProblemGeneric.py | jdsika/holy | a2ac55fa1751a3a8038cf61d29b95005f36d6264 | [
"MIT"
] | 1 | 2016-06-13T01:29:51.000Z | 2016-06-14T00:38:27.000Z | openrave/sandbox/mintime/MintimeProblemGeneric.py | jdsika/holy | a2ac55fa1751a3a8038cf61d29b95005f36d6264 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (C) 2012 Quang-Cuong Pham <cuong.pham@normalesup.org>
#
# 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
#
... | 31.280967 | 101 | 0.598319 |
7941ab0b8607898e90d08708b1c307ee8533298e | 2,326 | py | Python | deepcell/layers/__init__.py | jizhouh/deepcell-tf | 491ece59f5024d73429477ebdcb437a6e67d766b | [
"Apache-2.0"
] | 1 | 2021-03-21T13:47:35.000Z | 2021-03-21T13:47:35.000Z | deepcell/layers/__init__.py | jizhouh/deepcell-tf | 491ece59f5024d73429477ebdcb437a6e67d766b | [
"Apache-2.0"
] | null | null | null | deepcell/layers/__init__.py | jizhouh/deepcell-tf | 491ece59f5024d73429477ebdcb437a6e67d766b | [
"Apache-2.0"
] | null | null | null | # Copyright 2016-2021 The Van Valen Lab at the California Institute of
# Technology (Caltech), with support from the Paul Allen Family Foundation,
# Google, & National Institutes of Health (NIH) under Grant U24CA224309-01.
# All rights reserved.
#
# Licensed under a modified Apache License, Version 2.0 (the "License");... | 43.074074 | 80 | 0.797077 |
7941ab847f1e6cb68e3f6b7139a875fa77188605 | 2,360 | py | Python | packet_sniff.py | YoussefEmad99/Real-Time-Whatsapp-Controller-Bot-For-Productivity | 8399a40a36222fad62b0026795ace9fdbeac6e29 | [
"MIT"
] | null | null | null | packet_sniff.py | YoussefEmad99/Real-Time-Whatsapp-Controller-Bot-For-Productivity | 8399a40a36222fad62b0026795ace9fdbeac6e29 | [
"MIT"
] | null | null | null | packet_sniff.py | YoussefEmad99/Real-Time-Whatsapp-Controller-Bot-For-Productivity | 8399a40a36222fad62b0026795ace9fdbeac6e29 | [
"MIT"
] | null | null | null | import socket
import struct
from struct import *
import sys
def ethernet_head(raw_data):
dest, src, prototype = struct.unpack('! 6s 6s H', raw_data[:14])
dest_mac = get_mac_addr(dest)
src_mac = get_mac_addr(src)
proto = socket.htons(prototype)
data = raw_data[14:]
return dest_mac, src_mac, pro... | 33.239437 | 122 | 0.65339 |
7941ad23d0e4598ff55148d210804698a757cf05 | 16,025 | py | Python | build/PureCloudPlatformClientV2/models/queue_conversation_event_topic_chat.py | cjohnson-ctl/platform-client-sdk-python | 38ce53bb8012b66e8a43cc8bd6ff00cf6cc99100 | [
"MIT"
] | 10 | 2019-02-22T00:27:08.000Z | 2021-09-12T23:23:44.000Z | libs/PureCloudPlatformClientV2/models/queue_conversation_event_topic_chat.py | rocketbot-cl/genesysCloud | dd9d9b5ebb90a82bab98c0d88b9585c22c91f333 | [
"MIT"
] | 5 | 2018-06-07T08:32:00.000Z | 2021-07-28T17:37:26.000Z | libs/PureCloudPlatformClientV2/models/queue_conversation_event_topic_chat.py | rocketbot-cl/genesysCloud | dd9d9b5ebb90a82bab98c0d88b9585c22c91f333 | [
"MIT"
] | 6 | 2020-04-09T17:43:07.000Z | 2022-02-17T08:48:05.000Z | # coding: utf-8
"""
Copyright 2016 SmartBear Software
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... | 28.873874 | 258 | 0.626147 |
7941ae8187ce6780b57d172f93a1be15e139a494 | 2,159 | py | Python | helpers.py | espogabe/Textbook-Server | 6f6ee1640ffa7b25b33ad562eab9b5504362da63 | [
"MIT"
] | null | null | null | helpers.py | espogabe/Textbook-Server | 6f6ee1640ffa7b25b33ad562eab9b5504362da63 | [
"MIT"
] | null | null | null | helpers.py | espogabe/Textbook-Server | 6f6ee1640ffa7b25b33ad562eab9b5504362da63 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# Copyright (c) 2016 Aaron Zhao
# Copyright (c) 2016 Gabriel Esposito
# See LICENSE for details.
"""
Helper functions for the server.
"""
import decimal
from math import acos, cos, sin
import ConfigParser
EARTH_R = 3959 # Miles
def point_near(lat, lng, rlat, rlng, r):
"""Returns true if... | 26.9875 | 99 | 0.630848 |
7941aef39f6521ba5f763ac285cd6b53b3a60403 | 2,797 | py | Python | src/visual_func/visualize.py | VincentGaoHJ/Nonnegative-Matrix-Factorization | c272bfd6de86b9e2c815f4e4e8629cc27073edd6 | [
"MIT"
] | 1 | 2021-01-29T14:43:58.000Z | 2021-01-29T14:43:58.000Z | src/visual_func/visualize.py | VincentGaoHJ/Nonnegative-Matrix-Factorization | c272bfd6de86b9e2c815f4e4e8629cc27073edd6 | [
"MIT"
] | null | null | null | src/visual_func/visualize.py | VincentGaoHJ/Nonnegative-Matrix-Factorization | c272bfd6de86b9e2c815f4e4e8629cc27073edd6 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on 2019/3/18
@author: Haojun Gao
"""
import os
import heapq
import pickle
import numpy as np
import matplotlib.pyplot as plt
from sklearn.decomposition import PCA
from mpl_toolkits.mplot3d import Axes3D
from src.config import (
VISUAL_TYPE)
def normalize(data):
for i in r... | 30.402174 | 104 | 0.592778 |
7941afeb1814bce5c95d4ac3fc25de0d4439bb66 | 3,030 | py | Python | samples/03.welcome-user/app.py | hangdong/botbuilder-python | 8ff979a58fadc4356d76b9ce577f94da3245f664 | [
"MIT"
] | null | null | null | samples/03.welcome-user/app.py | hangdong/botbuilder-python | 8ff979a58fadc4356d76b9ce577f94da3245f664 | [
"MIT"
] | null | null | null | samples/03.welcome-user/app.py | hangdong/botbuilder-python | 8ff979a58fadc4356d76b9ce577f94da3245f664 | [
"MIT"
] | null | null | null | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
import asyncio
import sys
from datetime import datetime
from flask import Flask, request, Response
from botbuilder.core import (
BotFrameworkAdapter,
BotFrameworkAdapterSettings,
MemoryStorage,
TurnContext,
... | 31.5625 | 88 | 0.70099 |
7941aff7295eb87aa9c2575e9780b8d422b98de8 | 739 | py | Python | broken/qt5.py | FnControlOption/winbrew | 0fcf0d46fa22c48c6d92115b17234650dcb9ff0f | [
"MIT"
] | 19 | 2015-03-18T01:11:20.000Z | 2021-08-01T18:51:54.000Z | broken/qt5.py | FnControlOption/winbrew | 0fcf0d46fa22c48c6d92115b17234650dcb9ff0f | [
"MIT"
] | 11 | 2015-12-17T02:13:10.000Z | 2017-07-21T14:15:13.000Z | broken/qt5.py | FnControlOption/winbrew | 0fcf0d46fa22c48c6d92115b17234650dcb9ff0f | [
"MIT"
] | 6 | 2015-05-14T19:50:15.000Z | 2020-11-22T08:55:03.000Z | import winbrew
import os
class Qt5(winbrew.Formula):
url = 'https://github.com/qt/qt5.git#v5.9.0-alpha1'
homepage = 'https://www.qt.io'
sha1 = '020954eb0240fa18e488afb8adc3e948b0e08907'
build_deps = ()
deps = ()
def build(self):
os.environ.update({
'QTMAKESPEC': 'win32-msvc... | 28.423077 | 65 | 0.533153 |
7941b069c00c95d2043ebc2cb546b592fe695e1a | 4,552 | py | Python | otcextensions/sdk/css/v1/flavor.py | kucerakk/python-otcextensions | d74d6aaa6dcf7c46d2c5fbe3676656baaf8e81d6 | [
"Apache-2.0"
] | null | null | null | otcextensions/sdk/css/v1/flavor.py | kucerakk/python-otcextensions | d74d6aaa6dcf7c46d2c5fbe3676656baaf8e81d6 | [
"Apache-2.0"
] | null | null | null | otcextensions/sdk/css/v1/flavor.py | kucerakk/python-otcextensions | d74d6aaa6dcf7c46d2c5fbe3676656baaf8e81d6 | [
"Apache-2.0"
] | null | null | null | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | 41.381818 | 78 | 0.610062 |
7941b069e2bf0ad401c5db5604fb1b188fde0f7f | 398 | py | Python | env/Lib/site-packages/plotly/validators/scattergl/_x.py | andresgreen-byte/Laboratorio-1--Inversion-de-Capital | 8a4707301d19c3826c31026c4077930bcd6a8182 | [
"MIT"
] | 11,750 | 2015-10-12T07:03:39.000Z | 2022-03-31T20:43:15.000Z | venv/Lib/site-packages/plotly/validators/scattergl/_x.py | wakisalvador/constructed-misdirection | 74779e9ec640a11bc08d5d1967c85ac4fa44ea5e | [
"Unlicense"
] | 2,951 | 2015-10-12T00:41:25.000Z | 2022-03-31T22:19:26.000Z | venv/Lib/site-packages/plotly/validators/scattergl/_x.py | wakisalvador/constructed-misdirection | 74779e9ec640a11bc08d5d1967c85ac4fa44ea5e | [
"Unlicense"
] | 2,623 | 2015-10-15T14:40:27.000Z | 2022-03-28T16:05:50.000Z | import _plotly_utils.basevalidators
class XValidator(_plotly_utils.basevalidators.DataArrayValidator):
def __init__(self, plotly_name="x", parent_name="scattergl", **kwargs):
super(XValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
edit_type=k... | 33.166667 | 75 | 0.673367 |
7941b0a375a4067595a0680b647b7b6f9299482c | 11,049 | py | Python | examples/encoding/keyframe_archive_encoding.py | camberbridge/bitmovin-python | 3af4c6e79b0291fda05fd1ceeb5bed1bba9f3c95 | [
"Unlicense"
] | 44 | 2016-12-12T17:37:23.000Z | 2021-03-03T09:48:48.000Z | examples/encoding/keyframe_archive_encoding.py | camberbridge/bitmovin-python | 3af4c6e79b0291fda05fd1ceeb5bed1bba9f3c95 | [
"Unlicense"
] | 38 | 2017-01-09T14:45:45.000Z | 2022-02-27T18:04:33.000Z | examples/encoding/keyframe_archive_encoding.py | camberbridge/bitmovin-python | 3af4c6e79b0291fda05fd1ceeb5bed1bba9f3c95 | [
"Unlicense"
] | 27 | 2017-02-02T22:49:31.000Z | 2019-11-21T07:04:57.000Z | import datetime
from bitmovin import Bitmovin, Encoding, HTTPSInput, S3Output, StreamInput, SelectionMode, Stream, EncodingOutput, \
ACLEntry, ACLPermission, MuxingStream, CloudRegion, ProgressiveMOVMuxing, MJPEGCodecConfiguration, \
H264CodecConfiguration, H264Profile, FMP4Muxing, AACCodecConfiguration, DashM... | 46.0375 | 119 | 0.603403 |
7941b130d7dc819b5a50c46b65945c030617b3b2 | 3,634 | py | Python | mother_adp.py | dimelab-public/MTConnect-Testbed-Simulator-Public | 4b42052953d042418ddecbd5ed8608ccbdbaa189 | [
"MIT"
] | null | null | null | mother_adp.py | dimelab-public/MTConnect-Testbed-Simulator-Public | 4b42052953d042418ddecbd5ed8608ccbdbaa189 | [
"MIT"
] | null | null | null | mother_adp.py | dimelab-public/MTConnect-Testbed-Simulator-Public | 4b42052953d042418ddecbd5ed8608ccbdbaa189 | [
"MIT"
] | 1 | 2019-12-09T14:52:18.000Z | 2019-12-09T14:52:18.000Z | # -*- coding: utf-8 -*-
import pandas as pd
import random
from math import floor
master = pd.read_csv('dbs\master.csv')
#////////////////////////////////////////////////""
file = open("parameters.txt","r+")
parameters=dict()
lines = file.readlines()
for i in lines:
temp=i.split("=")
parameters[temp[0]]=temp[1... | 27.740458 | 110 | 0.524216 |
7941b3bbc3287c5506969b4e7dd66c1e883f6e8b | 15,257 | py | Python | spinup/algos/pytorch/sac/sac.py | yangyujie-jack/spinningup | 794f6e824450ec3b20abac6e0b8405d4b065e7dd | [
"MIT"
] | null | null | null | spinup/algos/pytorch/sac/sac.py | yangyujie-jack/spinningup | 794f6e824450ec3b20abac6e0b8405d4b065e7dd | [
"MIT"
] | null | null | null | spinup/algos/pytorch/sac/sac.py | yangyujie-jack/spinningup | 794f6e824450ec3b20abac6e0b8405d4b065e7dd | [
"MIT"
] | null | null | null | from copy import deepcopy
import itertools
import numpy as np
import torch
from torch.optim import Adam
import gym
# import time
import spinup.algos.pytorch.sac.core as core
# from spinup.utils.logx import EpochLogger
from spinup.utils.logger import Logger
class ReplayBuffer:
"""
A simple FIFO experience repl... | 40.685333 | 97 | 0.577178 |
7941b47491b8a6794f599df8e11505978523a136 | 162 | py | Python | src/domain/use_cases/__init__.py | panda-coder/py-clean-flask | e7b8af5056178cd1dc6161f52a909f8043dc4b66 | [
"MIT"
] | null | null | null | src/domain/use_cases/__init__.py | panda-coder/py-clean-flask | e7b8af5056178cd1dc6161f52a909f8043dc4b66 | [
"MIT"
] | null | null | null | src/domain/use_cases/__init__.py | panda-coder/py-clean-flask | e7b8af5056178cd1dc6161f52a909f8043dc4b66 | [
"MIT"
] | null | null | null | __all__ = ['Sum', 'Subtract', 'Multiply', 'Divide']
from .sum import Sum
from .subtract import Subtract
from .multiply import Multiply
from .divide import Divide | 27 | 51 | 0.753086 |
7941b4849565fedc8bcf58146b78f4b338d978d9 | 693 | py | Python | src/opencv/17_smoothing-blurring-images.py | prakashdale/prakashdale.github.io | 7e23a4f5d8c9c64bcc910ef6e0b7337a65feeff2 | [
"MIT"
] | null | null | null | src/opencv/17_smoothing-blurring-images.py | prakashdale/prakashdale.github.io | 7e23a4f5d8c9c64bcc910ef6e0b7337a65feeff2 | [
"MIT"
] | null | null | null | src/opencv/17_smoothing-blurring-images.py | prakashdale/prakashdale.github.io | 7e23a4f5d8c9c64bcc910ef6e0b7337a65feeff2 | [
"MIT"
] | null | null | null | import cv2
import numpy as np
from matplotlib import pyplot as plt
img = cv2.imread('saltandpeppernoise.jpg')
img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
kernal = np.ones((5,5), np.float)/25
dst = cv2.filter2D(img, -1, kernal) #homogeneous filter
blur = cv2.blur(img, (5, 5))
gblur = cv2.GaussianBlur(img, (5,5), 0)
med... | 26.653846 | 76 | 0.66811 |
7941b486af3e6619ab735083b37ae8a270435969 | 4,324 | py | Python | clinicaltrials/frontend/custom_rest_views.py | chadmiller/clinicaltrials-act-tracker | d16f5ff7b1fde673e7b00cd674666a19b19bf092 | [
"MIT"
] | null | null | null | clinicaltrials/frontend/custom_rest_views.py | chadmiller/clinicaltrials-act-tracker | d16f5ff7b1fde673e7b00cd674666a19b19bf092 | [
"MIT"
] | null | null | null | clinicaltrials/frontend/custom_rest_views.py | chadmiller/clinicaltrials-act-tracker | d16f5ff7b1fde673e7b00cd674666a19b19bf092 | [
"MIT"
] | null | null | null | """Custom django-rest-framework views to support API representation of
our data.
The names of the ordering and search fields are coupled to names
expected to be used by the DataTables javascript library (see
`site.js`).
See also custom_rest_backends.py
"""
from django.db.models import Count
from django.db.models imp... | 33.261538 | 86 | 0.70074 |
7941b4c100de80eff5db3374f7eaefbb4f329a12 | 9,175 | py | Python | backbone/deeplabv3_cosnet/deeplabv3.py | lartpang/OpticalFlowBasedVOS | cd4856644b77dd963133797c543aeafb4f402217 | [
"MIT"
] | 6 | 2020-11-19T04:20:52.000Z | 2021-09-24T02:40:11.000Z | backbone/deeplabv3_cosnet/deeplabv3.py | lartpang/OpticalFlowBasedVOS | cd4856644b77dd963133797c543aeafb4f402217 | [
"MIT"
] | null | null | null | backbone/deeplabv3_cosnet/deeplabv3.py | lartpang/OpticalFlowBasedVOS | cd4856644b77dd963133797c543aeafb4f402217 | [
"MIT"
] | 2 | 2020-11-22T02:02:18.000Z | 2021-11-14T08:56:15.000Z | # -*- coding: utf-8 -*-
"""
Created on Sun Sep 16 10:01:14 2018
@author: carri
"""
import torch
import torch.nn as nn
import torch.nn.functional as F
__all__ = ["Res_Deeplab"]
from backbone.utils import load_pretrained_params
model_urls = {"res_deeplabv3": "/home/lart/Datasets/PretainedWeighted/deeplab_davis_12_0.... | 32.306338 | 98 | 0.575259 |
7941b54ea6b62157415200f5c5f39f609e13e95e | 1,164 | py | Python | logger/__init__.py | 3lpsy/FactionAPI | e3659c4a1a1cbdefcf6c3a240ee6db1475e3b022 | [
"BSD-3-Clause"
] | null | null | null | logger/__init__.py | 3lpsy/FactionAPI | e3659c4a1a1cbdefcf6c3a240ee6db1475e3b022 | [
"BSD-3-Clause"
] | null | null | null | logger/__init__.py | 3lpsy/FactionAPI | e3659c4a1a1cbdefcf6c3a240ee6db1475e3b022 | [
"BSD-3-Clause"
] | null | null | null | from datetime import datetime
import logging
from os import environ
DEFAULT_LEVEL_STR = environ.get("DEFAULT_LOGGING_LEVEL", "INFO")
DEFAULT_LEVEL = getattr(logging, DEFAULT_LEVEL_STR.upper(), "INFO")
ROOT_LOGGER = logging.getLogger() # get root logger
if environ.get("GUNICORN_SERVER", "gunicorn") == "flask":
ROO... | 40.137931 | 124 | 0.666667 |
7941b5ac5fcb9bc47e2e434387655dc943744c03 | 4,552 | py | Python | parser/fase2/team21/Analisis_Ascendente/Instrucciones/Delete/delete.py | webdev188/tytus | 847071edb17b218f51bb969d335a8ec093d13f94 | [
"MIT"
] | 35 | 2020-12-07T03:11:43.000Z | 2021-04-15T17:38:16.000Z | parser/fase2/team21/Analisis_Ascendente/Instrucciones/Delete/delete.py | webdev188/tytus | 847071edb17b218f51bb969d335a8ec093d13f94 | [
"MIT"
] | 47 | 2020-12-09T01:29:09.000Z | 2021-01-13T05:37:50.000Z | parser/fase2/team21/Analisis_Ascendente/Instrucciones/Delete/delete.py | webdev188/tytus | 847071edb17b218f51bb969d335a8ec093d13f94 | [
"MIT"
] | 556 | 2020-12-07T03:13:31.000Z | 2021-06-17T17:41:10.000Z | #from Instrucciones.instruccion import Instruccion
from tytus.parser.fase2.team21.Analisis_Ascendente.Instrucciones.expresion import Id
from tytus.parser.fase2.team21.Analisis_Ascendente.Instrucciones.instruccion import Instruccion
from tytus.parser.fase2.team21.Analisis_Ascendente.Instrucciones.Expresiones.Expresion i... | 44.627451 | 166 | 0.607645 |
7941b6e08a6b23944762115eda171337a24a71b2 | 4,146 | py | Python | pesummary/conf/configuration.py | pesummary/pesummary | 99e3c450ecbcaf5a23564d329bdf6e0080f6f2a8 | [
"MIT"
] | 1 | 2021-08-03T05:58:20.000Z | 2021-08-03T05:58:20.000Z | pesummary/conf/configuration.py | pesummary/pesummary | 99e3c450ecbcaf5a23564d329bdf6e0080f6f2a8 | [
"MIT"
] | 1 | 2020-06-13T13:29:35.000Z | 2020-06-15T12:45:04.000Z | pesummary/conf/configuration.py | pesummary/pesummary | 99e3c450ecbcaf5a23564d329bdf6e0080f6f2a8 | [
"MIT"
] | 3 | 2021-07-08T08:31:28.000Z | 2022-03-31T14:08:58.000Z | import numpy as np
import pkg_resources
import os
# matplotlib style file
_path = pkg_resources.resource_filename("pesummary", "conf")
style_file = os.path.join(_path, "matplotlib_rcparams.sty")
# checkpoint file
checkpoint_dir = lambda webdir: os.path.join(webdir, "checkpoint")
resume_file = "pesummary_resume.pickle... | 29.827338 | 79 | 0.738061 |
7941b7c8976903eb727dc15e9dace5065fc0c15c | 2,350 | py | Python | tests/admin_views/customadmin.py | devops2014/djangosite | db77915c9fd35a203edd8206f702ee4082f04d4a | [
"BSD-3-Clause"
] | null | null | null | tests/admin_views/customadmin.py | devops2014/djangosite | db77915c9fd35a203edd8206f702ee4082f04d4a | [
"BSD-3-Clause"
] | null | null | null | tests/admin_views/customadmin.py | devops2014/djangosite | db77915c9fd35a203edd8206f702ee4082f04d4a | [
"BSD-3-Clause"
] | null | null | null | """
A second, custom AdminSite -- see tests.CustomAdminSiteTests.
"""
from __future__ import unicode_literals
from django.conf.urls import url
from django.contrib import admin
from django.contrib.auth.admin import UserAdmin
from django.contrib.auth.models import User
from django.http import HttpResponse
from . import... | 36.71875 | 110 | 0.760851 |
7941b83bf5073eef4526c8f62276f7acd2b96ef2 | 1,745 | py | Python | linear.py | dataubc/Modeling_IFT_for_heavy_oil_emulsion | e9a9e75fbf6434d755979c4b616801d60c8a617f | [
"MIT"
] | 1 | 2021-05-02T17:19:31.000Z | 2021-05-02T17:19:31.000Z | linear.py | dataubc/Modeling_IFT_for_heavy_oil_emulsion | e9a9e75fbf6434d755979c4b616801d60c8a617f | [
"MIT"
] | null | null | null | linear.py | dataubc/Modeling_IFT_for_heavy_oil_emulsion | e9a9e75fbf6434d755979c4b616801d60c8a617f | [
"MIT"
] | null | null | null | import pandas as pd
# import#
from sklearn.pipeline import Pipeline
from sklearn.linear_model import Ridge
from sklearn.model_selection import train_test_split, GridSearchCV
from sklearn.compose import ColumnTransformer
from sklearn.impute import SimpleImputer
from sklearn.preprocessing import StandardScaler, OneHotE... | 30.086207 | 106 | 0.668195 |
7941b844333b6719b7ed592b0a195a10f93a336d | 319 | py | Python | algo/bitwise/bit_sign.py | tkornuta/python-sandbox | 00e03cd3f49ebb014611d67aad886aaff04c058f | [
"Apache-2.0"
] | null | null | null | algo/bitwise/bit_sign.py | tkornuta/python-sandbox | 00e03cd3f49ebb014611d67aad886aaff04c058f | [
"Apache-2.0"
] | null | null | null | algo/bitwise/bit_sign.py | tkornuta/python-sandbox | 00e03cd3f49ebb014611d67aad886aaff04c058f | [
"Apache-2.0"
] | null | null | null | # Get sign with bitwise operations only.
def bit_sign(d):
print("d: {0:b}".format(d))
# NOT WORKING FOR 2,4,8, 16 etc.!!!!
sign = ((d & (1 << (d.bit_length() - 1))) != 0)
return sign
def sign(x):
return 1*(x>0)
#return 1-(x<=0)
if __name__ == "__main__":
d = -15
print(bit_sign(d))
| 17.722222 | 51 | 0.532915 |
7941b867646f98bfe651ab42e8290f3233aa457e | 1,545 | py | Python | pyEX/stocks/fundamentalValuations.py | adamklaff/pyEX | 74a4cfa5978ccff95261aeb54f526dedc579aa6b | [
"Apache-2.0"
] | 335 | 2017-11-06T00:45:41.000Z | 2022-03-14T10:17:36.000Z | pyEX/stocks/fundamentalValuations.py | adamklaff/pyEX | 74a4cfa5978ccff95261aeb54f526dedc579aa6b | [
"Apache-2.0"
] | 193 | 2018-02-11T21:39:35.000Z | 2022-02-25T15:46:38.000Z | pyEX/stocks/fundamentalValuations.py | adamklaff/pyEX | 74a4cfa5978ccff95261aeb54f526dedc579aa6b | [
"Apache-2.0"
] | 92 | 2017-11-10T08:09:35.000Z | 2022-02-16T19:27:46.000Z | # *****************************************************************************
#
# Copyright (c) 2020, the pyEX authors.
#
# This file is part of the pyEX library, distributed under the terms of
# the Apache License 2.0. The full license can be found in the LICENSE file.
#
from functools import wraps
import pandas a... | 26.186441 | 85 | 0.632362 |
7941ba0707653b5c782dd4931d5840c9e40d34f1 | 461 | py | Python | saveDB.py | chenmengchieh2012/ESPCentralController | 1526da22033e476332514350ff10eb8459445ed0 | [
"MIT"
] | null | null | null | saveDB.py | chenmengchieh2012/ESPCentralController | 1526da22033e476332514350ff10eb8459445ed0 | [
"MIT"
] | null | null | null | saveDB.py | chenmengchieh2012/ESPCentralController | 1526da22033e476332514350ff10eb8459445ed0 | [
"MIT"
] | null | null | null | import os, shutil
from datetime import datetime
print("My working path is ", os.getcwd())
now = datetime.now()
timestamp = now.strftime("%Y-%m-%d_%H-%M")
originName = 'esp-rssi-measurements-sqlite.db'
newName = 'esp-rssi-measurements-sqlite_'+timestamp+'.db'
print("originName: ", originName)
print("newName: ", newNa... | 28.8125 | 72 | 0.70282 |
7941ba169a839e8d936f22b731b9cca847a88545 | 1,182 | py | Python | quantizer.py | javigm98/Mejorando-el-Aprendizaje-Automatico | fefdbb5c3b3826230738b3e5fbd76f64e701d344 | [
"MIT"
] | null | null | null | quantizer.py | javigm98/Mejorando-el-Aprendizaje-Automatico | fefdbb5c3b3826230738b3e5fbd76f64e701d344 | [
"MIT"
] | null | null | null | quantizer.py | javigm98/Mejorando-el-Aprendizaje-Automatico | fefdbb5c3b3826230738b3e5fbd76f64e701d344 | [
"MIT"
] | null | null | null | import sys
dataset_dir = sys.argv[1]
h5_dir = sys.argv[2]
tflite_dir= sys.argv[3]
images = []
import numpy as np
with open(dataset_dir, 'rb') as f:
for _ in range(500):
images.append(np.load(f))
print("Loaded images shape: ", images[20].shape)
import tensorflow as tf
def representative_data_gen():
fo... | 33.771429 | 80 | 0.769882 |
7941ba65b8a6f6b10e87d8c8c87e982f52d85178 | 68 | py | Python | ramda/equals.py | Rafi993/pyramda | 4fa7fe28d5eaa798b702d28bdd3948515cb88f48 | [
"MIT"
] | 1 | 2018-08-05T04:41:14.000Z | 2018-08-05T04:41:14.000Z | ramda/equals.py | Rafi993/pyramda | 4fa7fe28d5eaa798b702d28bdd3948515cb88f48 | [
"MIT"
] | 3 | 2018-06-12T18:42:05.000Z | 2018-07-23T11:50:25.000Z | ramda/equals.py | slavaGanzin/pyramda | 4fa7fe28d5eaa798b702d28bdd3948515cb88f48 | [
"MIT"
] | null | null | null | from ramda.curry import curry
equals = curry(lambda x, y: x == y)
| 13.6 | 35 | 0.676471 |
7941bad146678f1a9925d97a12840e01b67645dd | 479 | py | Python | tests/conftest.py | TomAB99/kima | 15e13159dd7bdaa4053e3157cbf5f562ee988461 | [
"MIT"
] | 14 | 2017-11-13T19:45:35.000Z | 2021-09-23T14:15:10.000Z | tests/conftest.py | TomAB99/kima | 15e13159dd7bdaa4053e3157cbf5f562ee988461 | [
"MIT"
] | 67 | 2017-11-03T13:57:54.000Z | 2021-12-03T13:54:51.000Z | tests/conftest.py | TomAB99/kima | 15e13159dd7bdaa4053e3157cbf5f562ee988461 | [
"MIT"
] | 15 | 2017-11-09T11:31:57.000Z | 2022-03-03T11:02:03.000Z | import pytest
def pytest_addoption(parser):
parser.addoption("--slow", action="store_true",
default=False, help="run slow tests")
def pytest_collection_modifyitems(config, items):
if config.getoption("--slow"):
# --runslow given in cli: do not skip slow tests
return
ski... | 36.846154 | 68 | 0.647182 |
7941bc07421ffb7ff7e21f82e463bbb1efeb61bb | 1,079 | py | Python | pyvisdk/do/invalid_network_in_type.py | Infinidat/pyvisdk | f2f4e5f50da16f659ccc1d84b6a00f397fa997f8 | [
"MIT"
] | null | null | null | pyvisdk/do/invalid_network_in_type.py | Infinidat/pyvisdk | f2f4e5f50da16f659ccc1d84b6a00f397fa997f8 | [
"MIT"
] | null | null | null | pyvisdk/do/invalid_network_in_type.py | Infinidat/pyvisdk | f2f4e5f50da16f659ccc1d84b6a00f397fa997f8 | [
"MIT"
] | null | null | null |
import logging
from pyvisdk.exceptions import InvalidArgumentError
########################################
# Automatically generated, do not edit.
########################################
log = logging.getLogger(__name__)
def InvalidNetworkInType(vim, *args, **kwargs):
'''The network specified in the property ... | 31.735294 | 124 | 0.599629 |
7941bcb2d2218e99528141883dfb7383be5c59f5 | 19,285 | py | Python | benchmarks/f3_wrong_hints/scaling_ltl_timed_transition_system/18-sender_receiver_1.py | EnricoMagnago/F3 | c863215c318d7d5f258eb9be38c6962cf6863b52 | [
"MIT"
] | 3 | 2021-04-23T23:29:26.000Z | 2022-03-23T10:00:30.000Z | benchmarks/f3_wrong_hints/scaling_ltl_timed_transition_system/18-sender_receiver_1.py | EnricoMagnago/F3 | c863215c318d7d5f258eb9be38c6962cf6863b52 | [
"MIT"
] | null | null | null | benchmarks/f3_wrong_hints/scaling_ltl_timed_transition_system/18-sender_receiver_1.py | EnricoMagnago/F3 | c863215c318d7d5f258eb9be38c6962cf6863b52 | [
"MIT"
] | 1 | 2021-11-17T22:02:56.000Z | 2021-11-17T22:02:56.000Z | from typing import FrozenSet
from collections import Iterable
from math import log, ceil
from mathsat import msat_term, msat_env
from mathsat import msat_make_constant, msat_declare_function
from mathsat import msat_get_integer_type, msat_get_rational_type, msat_get_bool_type
from mathsat import msat_make_and, msa... | 38.037475 | 89 | 0.579051 |
7941be46bcd117d74bb0ee1fa0c4e7674edd0d6d | 61,925 | py | Python | beets/ui/commands.py | Ruin0x11/beets | 0077c0514b2bc515336cc00e58f5a239d4d032f4 | [
"MIT"
] | null | null | null | beets/ui/commands.py | Ruin0x11/beets | 0077c0514b2bc515336cc00e58f5a239d4d032f4 | [
"MIT"
] | null | null | null | beets/ui/commands.py | Ruin0x11/beets | 0077c0514b2bc515336cc00e58f5a239d4d032f4 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# This file is part of beets.
# Copyright 2016, Adrian Sampson.
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation t... | 34.212707 | 79 | 0.600501 |
7941becb8231517b90e18e24c8ae941c3cd4c93d | 5,740 | py | Python | tests/data/dummy_aea/protocols/fipa/message.py | 8ball030/agents-aea | fcf470e3daa9bd8e272ca66542c6003feb0fd7a8 | [
"Apache-2.0"
] | 1 | 2021-07-25T18:50:18.000Z | 2021-07-25T18:50:18.000Z | tests/data/dummy_aea/protocols/fipa/message.py | 8ball030/agents-aea | fcf470e3daa9bd8e272ca66542c6003feb0fd7a8 | [
"Apache-2.0"
] | null | null | null | tests/data/dummy_aea/protocols/fipa/message.py | 8ball030/agents-aea | fcf470e3daa9bd8e272ca66542c6003feb0fd7a8 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
#
# Copyright 2018-2019 Fetch.AI Limited
#
# 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... | 44.84375 | 178 | 0.632753 |
7941bf0f82aa38d11193e277dd38c447c3de82b0 | 10,568 | py | Python | lib/sqlalchemy/testing/fixtures.py | smarkets/sqlalchemy | 9c96d96d0fe558d625755277e0b23a7bc82cd148 | [
"MIT"
] | 1 | 2015-11-07T12:34:26.000Z | 2015-11-07T12:34:26.000Z | lib/sqlalchemy/testing/fixtures.py | smarkets/sqlalchemy | 9c96d96d0fe558d625755277e0b23a7bc82cd148 | [
"MIT"
] | 4 | 2017-10-24T22:44:01.000Z | 2017-10-24T22:44:19.000Z | lib/sqlalchemy/testing/fixtures.py | smarkets/sqlalchemy | 9c96d96d0fe558d625755277e0b23a7bc82cd148 | [
"MIT"
] | 1 | 2021-03-25T00:26:15.000Z | 2021-03-25T00:26:15.000Z | # testing/fixtures.py
# Copyright (C) 2005-2014 the SQLAlchemy authors and contributors <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
from . import config
from . import assertions, schema
from .util import adict
from... | 27.737533 | 84 | 0.612226 |
7941bf5be5f779ae35d10e625fed60c32d0e7ba9 | 1,081 | py | Python | gentool/__main__.py | TheDudeFromCI/generative-toolkit | 4a0aed629b72e6eea807dadc460afa90dd330f7f | [
"MIT"
] | null | null | null | gentool/__main__.py | TheDudeFromCI/generative-toolkit | 4a0aed629b72e6eea807dadc460afa90dd330f7f | [
"MIT"
] | null | null | null | gentool/__main__.py | TheDudeFromCI/generative-toolkit | 4a0aed629b72e6eea807dadc460afa90dd330f7f | [
"MIT"
] | null | null | null | import sys
import argparse
import torch
from ModelLoader import load_model
def main():
parser = argparse.ArgumentParser(prog='gentool')
parser.add_argument("--training", action='store_true', help="Whether or not to start the model in training mode.")
parser.add_argument("--model", type=str, help="The mo... | 27.025 | 118 | 0.676226 |
7941c14a923233de518cd7c4d57e8b8a8943548c | 1,217 | py | Python | demos/time_tsts/bound_arr/ibeam.py | tbcole/majoranaJJ | dcf31f7786fa0a4874a940b7d8dcdd55f3921a46 | [
"MIT"
] | null | null | null | demos/time_tsts/bound_arr/ibeam.py | tbcole/majoranaJJ | dcf31f7786fa0a4874a940b7d8dcdd55f3921a46 | [
"MIT"
] | 2 | 2020-03-24T23:46:17.000Z | 2020-04-19T20:29:08.000Z | demos/time_tsts/bound_arr/ibeam.py | tbcole/majoranaJJ | dcf31f7786fa0a4874a940b7d8dcdd55f3921a46 | [
"MIT"
] | 3 | 2020-04-30T08:48:12.000Z | 2022-01-26T12:15:15.000Z | import time
import majoranaJJ.lattice.shapes as shps #lattice shapes
import majoranaJJ.junk.lattice.neighbors as nb2
import majoranaJJ.lattice.nbrs as nb #neighbor arrays
import majoranaJJ.modules.plots as plots #plotting functions
print("")
xbase = 40
xcut = 5
y1 = 10
y2 = 10
#Making square lattice, nothing has cha... | 25.354167 | 81 | 0.636812 |
7941c16c34070a51c64bf76aab1f8c34a314ac05 | 4,979 | py | Python | lesson5.4/index.py | magnusmel/Serverless-Deep-Learning-with-TensorFlow-and-AWS-Lambda | cc226deb7b46852407900f9fec0caf62638defe2 | [
"MIT"
] | 21 | 2018-12-11T20:07:47.000Z | 2021-11-08T13:12:32.000Z | lesson5.4/index.py | magnusmel/Serverless-Deep-Learning-with-TensorFlow-and-AWS-Lambda | cc226deb7b46852407900f9fec0caf62638defe2 | [
"MIT"
] | 1 | 2020-07-07T21:30:02.000Z | 2020-07-08T18:16:03.000Z | lesson5.4/index.py | magnusmel/Serverless-Deep-Learning-with-TensorFlow-and-AWS-Lambda | cc226deb7b46852407900f9fec0caf62638defe2 | [
"MIT"
] | 15 | 2018-12-12T02:32:28.000Z | 2021-11-05T20:40:10.000Z | import boto3
import numpy as np
import tensorflow as tf
import os.path
import re
from urllib.request import urlretrieve
import json
SESSION = None
strBucket = 'serverlessdeeplearning'
def handler(event, context):
global strBucket
global SESSION
if not os.path.exists('/tmp/imagenet/'):
os.makedirs... | 37.43609 | 152 | 0.66198 |
7941c1f3859c4e7787c50eb7657d338c31cfbb8d | 7,433 | py | Python | bugzoo/mgr/build.py | pdreiter/BugZoo | e164ee67ff8bd3addfcc87b5e38ff1774992196b | [
"MIT"
] | 53 | 2017-12-02T03:22:06.000Z | 2022-03-10T22:20:52.000Z | bugzoo/mgr/build.py | pdreiter/BugZoo | e164ee67ff8bd3addfcc87b5e38ff1774992196b | [
"MIT"
] | 145 | 2017-11-29T23:23:06.000Z | 2020-09-17T22:17:44.000Z | bugzoo/mgr/build.py | pdreiter/BugZoo | e164ee67ff8bd3addfcc87b5e38ff1774992196b | [
"MIT"
] | 8 | 2018-06-26T17:58:49.000Z | 2021-09-07T14:03:41.000Z | from typing import Iterator
import os
import shutil
import json
import logging
import docker
from ..core.build import BuildInstructions
from ..exceptions import ImageBuildFailed
logger = logging.getLogger(__name__) # type: logging.Logger
logger.setLevel(logging.DEBUG)
class BuildManager(object):
def __init__(... | 34.09633 | 80 | 0.532625 |
7941c216a70c50b88b18f1bb6ce1feda73ebb1d6 | 1,008 | py | Python | batch/test/failure_injecting_client_session.py | tdeboer-ilmn/hail | 98fffc9b4e13cd5d5ced8322112894361d0b7052 | [
"MIT"
] | 789 | 2016-09-05T04:14:25.000Z | 2022-03-30T09:51:54.000Z | batch/test/failure_injecting_client_session.py | tdeboer-ilmn/hail | 98fffc9b4e13cd5d5ced8322112894361d0b7052 | [
"MIT"
] | 5,724 | 2016-08-29T18:58:40.000Z | 2022-03-31T23:49:42.000Z | batch/test/failure_injecting_client_session.py | tdeboer-ilmn/hail | 98fffc9b4e13cd5d5ced8322112894361d0b7052 | [
"MIT"
] | 233 | 2016-08-31T20:42:38.000Z | 2022-02-17T16:42:39.000Z | import aiohttp
from hailtop.utils import async_to_blocking
from hailtop.httpx import client_session
class FailureInjectingClientSession:
def __init__(self, should_fail):
self.should_fail = should_fail
self.real_session = client_session()
def __enter__(self):
return self
def __ex... | 33.6 | 106 | 0.667659 |
7941c237d1074c4355efe59d4b15a4ebbbfcfecc | 959 | py | Python | selfdrive/camerad/test/frame_test.py | cheeseonhead/openpilot | 4262a15a5ac7999c029a1d33a825f12dbae27806 | [
"MIT"
] | 1 | 2021-09-15T14:42:15.000Z | 2021-09-15T14:42:15.000Z | selfdrive/camerad/test/frame_test.py | cheeseonhead/openpilot | 4262a15a5ac7999c029a1d33a825f12dbae27806 | [
"MIT"
] | null | null | null | selfdrive/camerad/test/frame_test.py | cheeseonhead/openpilot | 4262a15a5ac7999c029a1d33a825f12dbae27806 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import numpy as np
import cereal.messaging as messaging
from PIL import ImageDraw, Image
# font = ImageFont.truetype("arial", size=72)
def get_frame(idx):
img = np.zeros((874, 1164, 3), np.uint8)
img[100:400, 100:100+(idx % 10) * 100] = 255
# big number
im2 = Image.new("RGB", (200, 200)... | 25.236842 | 72 | 0.629823 |
7941c3e92f738c5e5cf1937fd8a1bc8ddd9e0218 | 2,928 | py | Python | pkpdapp/pkpdapp/migrations/0007_initial_units.py | pkpdapp-team/pkpdapp | 8a9748ef52199ffdaa9194d0e1c384b4a78a70dc | [
"BSD-3-Clause"
] | 4 | 2020-11-10T10:13:32.000Z | 2021-09-22T15:24:23.000Z | pkpdapp/pkpdapp/migrations/0007_initial_units.py | pkpdapp-team/pkpdapp | 8a9748ef52199ffdaa9194d0e1c384b4a78a70dc | [
"BSD-3-Clause"
] | 232 | 2020-05-06T09:32:10.000Z | 2022-03-28T16:31:29.000Z | pkpdapp/pkpdapp/migrations/0007_initial_units.py | pkpdapp-team/pkpdapp | 8a9748ef52199ffdaa9194d0e1c384b4a78a70dc | [
"BSD-3-Clause"
] | 1 | 2020-10-13T11:40:06.000Z | 2020-10-13T11:40:06.000Z | #
# This file is part of PKPDApp (https://github.com/pkpdapp-team/pkpdapp) which
# is released under the BSD 3-clause license. See accompanying LICENSE.md for
# copyright notice and full license details.
#
from django.db import migrations
import myokit
def load_units(apps, schema_editor):
Unit = apps.get_model("... | 22.523077 | 78 | 0.362022 |
7941c3f7dfd3bc52c010981b3b2369faf4484baf | 3,501 | py | Python | ruspy/test/estimation_tests/test_ambiguity.py | MaxBlesch/ruspy | 5e7fb9e584c7e0d4935f4669e108bbf4e05209c6 | [
"MIT"
] | null | null | null | ruspy/test/estimation_tests/test_ambiguity.py | MaxBlesch/ruspy | 5e7fb9e584c7e0d4935f4669e108bbf4e05209c6 | [
"MIT"
] | null | null | null | ruspy/test/estimation_tests/test_ambiguity.py | MaxBlesch/ruspy | 5e7fb9e584c7e0d4935f4669e108bbf4e05209c6 | [
"MIT"
] | null | null | null | """
This module contains tests for the data and estimation code of the ruspy project. The
settings for this tests is specified in resources/replication_test/init_replication.yml.
The test first reads the original data, then processes the data to a pandas DataFrame
suitable for the estimation process. After estimating a... | 36.852632 | 88 | 0.674093 |
7941c4892a89d6aad54b39dd927244b33ac1017e | 1,623 | py | Python | examples/example_3d_simulate/example_3d_fit.py | gabemery/gammapy | 99e5c5d38e4920dddd7bca41fb1539ccda8bea2d | [
"BSD-3-Clause"
] | null | null | null | examples/example_3d_simulate/example_3d_fit.py | gabemery/gammapy | 99e5c5d38e4920dddd7bca41fb1539ccda8bea2d | [
"BSD-3-Clause"
] | null | null | null | examples/example_3d_simulate/example_3d_fit.py | gabemery/gammapy | 99e5c5d38e4920dddd7bca41fb1539ccda8bea2d | [
"BSD-3-Clause"
] | null | null | null | from astropy import log
from gammapy.image.models import SkyGaussian2D
from gammapy.spectrum.models import PowerLaw
from gammapy.maps import WcsNDMap
from gammapy.cube import SkyModel, SkyModelMapFit
from example_3d_simulate import get_sky_model
def load_cubes():
npred_cube = WcsNDMap.read('npred.fits')
expos... | 24.969231 | 66 | 0.635243 |
7941c4a3692a06b54c50f1757bf27f5423b2d2c4 | 1,431 | py | Python | tests/test_sources_bh.py | mirochaj/ares | b3335ad30435ee0d7f17d0110aa164a35f252d78 | [
"MIT"
] | 10 | 2020-03-26T01:08:10.000Z | 2021-12-04T13:02:10.000Z | tests/test_sources_bh.py | mirochaj/ares | b3335ad30435ee0d7f17d0110aa164a35f252d78 | [
"MIT"
] | 25 | 2020-06-08T14:52:28.000Z | 2022-03-08T02:30:54.000Z | tests/test_sources_bh.py | mirochaj/ares | b3335ad30435ee0d7f17d0110aa164a35f252d78 | [
"MIT"
] | 8 | 2020-03-24T14:11:25.000Z | 2021-11-06T06:32:59.000Z | """
test_sed_mcd.py
Author: Jordan Mirocha
Affiliation: University of Colorado at Boulder
Created on: Thu May 2 10:46:44 2013
Description: Plot a simple multi-color disk accretion spectrum.
"""
import ares
import numpy as np
def test():
rmax = 1e2
mass = 10.
fsc = 0.1
alpha = -1.5
Emin = 1e2
... | 19.60274 | 63 | 0.592593 |
7941c549a9c0c6e82156307a47e2467a3f65ed9b | 29,924 | py | Python | billforward/models/tiered_volume_pricing_component.py | billforward/bf-python | d2b812329ca3ed1fd94364d7f46f69ad74665596 | [
"Apache-2.0"
] | 2 | 2016-11-23T17:32:37.000Z | 2022-02-24T05:13:20.000Z | billforward/models/tiered_volume_pricing_component.py | billforward/bf-python | d2b812329ca3ed1fd94364d7f46f69ad74665596 | [
"Apache-2.0"
] | null | null | null | billforward/models/tiered_volume_pricing_component.py | billforward/bf-python | d2b812329ca3ed1fd94364d7f46f69ad74665596 | [
"Apache-2.0"
] | 1 | 2016-12-30T20:02:48.000Z | 2016-12-30T20:02:48.000Z | # coding: utf-8
"""
BillForward REST API
OpenAPI spec version: 1.0.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
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... | 38.119745 | 513 | 0.613287 |
7941c693bebe870b3bc3f75f8815ad4bb4b775c8 | 4,786 | py | Python | calc.py | luk707/ScientificCalculator | 343a6f3f7e926bd354aebf4803450aee4d5e1daa | [
"MIT"
] | 1 | 2017-09-16T04:23:20.000Z | 2017-09-16T04:23:20.000Z | calc.py | luk707/ScientificCalculator | 343a6f3f7e926bd354aebf4803450aee4d5e1daa | [
"MIT"
] | null | null | null | calc.py | luk707/ScientificCalculator | 343a6f3f7e926bd354aebf4803450aee4d5e1daa | [
"MIT"
] | 2 | 2017-03-14T12:39:38.000Z | 2020-02-03T09:46:57.000Z | import re
import sys
import math
class Token:
def __init__(self, type, value):
self.type = type
self.value = value
ans = 0
functions = {
"ans": lambda p: ans,
"exit": lambda p: sys.exit(0),
"mean": lambda numbers: float(sum(numbers)) / max(len(numbers), 1),
"sum": lambda numbers: ... | 23.009615 | 96 | 0.439616 |
7941c73ba594722a7d7028d097eabdbe0d26bf2e | 1,475 | py | Python | query_local_distro.py | jolivain/distro | 5d228805b91b4e2363703cb30185156645be433d | [
"Apache-2.0"
] | 30 | 2021-07-01T01:20:41.000Z | 2022-03-18T20:22:41.000Z | query_local_distro.py | jolivain/distro | 5d228805b91b4e2363703cb30185156645be433d | [
"Apache-2.0"
] | 64 | 2021-06-30T20:20:33.000Z | 2022-03-23T17:40:08.000Z | query_local_distro.py | jolivain/distro | 5d228805b91b4e2363703cb30185156645be433d | [
"Apache-2.0"
] | 10 | 2021-06-30T20:42:06.000Z | 2022-03-09T19:38:47.000Z | #!/usr/bin/env python
# Copyright 2015,2016 Nir Cohen
#
# 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 a... | 33.522727 | 74 | 0.742373 |
7941c7b37ba567f2ada60446a32f4137e8bbdc17 | 19,084 | py | Python | darts/datasets/__init__.py | bruecks2/darts | 4cf51f7cfffdc53049bdca6f9eb54eaf5810eaa5 | [
"Apache-2.0"
] | null | null | null | darts/datasets/__init__.py | bruecks2/darts | 4cf51f7cfffdc53049bdca6f9eb54eaf5810eaa5 | [
"Apache-2.0"
] | null | null | null | darts/datasets/__init__.py | bruecks2/darts | 4cf51f7cfffdc53049bdca6f9eb54eaf5810eaa5 | [
"Apache-2.0"
] | 1 | 2022-02-15T11:06:29.000Z | 2022-02-15T11:06:29.000Z | """
Datasets
--------
A few popular time series datasets
"""
from pathlib import Path
from typing import List
import numpy as np
import pandas as pd
from darts import TimeSeries
from darts.logging import get_logger, raise_if_not
from .dataset_loaders import DatasetLoaderCSV, DatasetLoaderMetadata
"""
Overall u... | 30.930308 | 131 | 0.586774 |
7941c9d2c59958b154a9fa01b4093b6872a1a085 | 1,370 | py | Python | examples/example.py | jkpubsrc/python-module-jk-trioping | a8a82530d1fab6056f3cbecf1c888cb39540c4a5 | [
"Apache-1.1"
] | null | null | null | examples/example.py | jkpubsrc/python-module-jk-trioping | a8a82530d1fab6056f3cbecf1c888cb39540c4a5 | [
"Apache-1.1"
] | null | null | null | examples/example.py | jkpubsrc/python-module-jk-trioping | a8a82530d1fab6056f3cbecf1c888cb39540c4a5 | [
"Apache-1.1"
] | null | null | null | #!/usr/bin/python3
import trio
import jk_trioping
async def main():
# single ping with host not answering
print("Pinging:", "7.7.7.7", "1 time")
t = trio.current_time()
duration = await jk_trioping.ping("7.7.7.7")
dt = trio.current_time() - t
print("Duration (1 ping):", duration, "ms")
print("Total time:",... | 24.035088 | 91 | 0.638686 |
7941c9eff35a95930bee97c7b7356aa9f69a069a | 4,804 | py | Python | main.py | grebtsew/ARNumpad | 2956cf6c72faf64c236d153fe1274d5ed626e83a | [
"MIT"
] | 1 | 2022-02-13T13:14:17.000Z | 2022-02-13T13:14:17.000Z | main.py | grebtsew/ARNumpad | 2956cf6c72faf64c236d153fe1274d5ed626e83a | [
"MIT"
] | null | null | null | main.py | grebtsew/ARNumpad | 2956cf6c72faf64c236d153fe1274d5ed626e83a | [
"MIT"
] | 3 | 2021-10-16T23:03:04.000Z | 2022-02-13T13:14:20.000Z | # MediaPipe Hands
#
# Sources:
# https://google.github.io/mediapipe/solutions/hands.html // original code
# https://gist.github.com/TheJLifeX/74958cc59db477a91837244ff598ef4a // gesture detection
# https://github.com/Kazuhito00/mediapipe-python-sample // performance
# https://github.com/JuliaPoo/MultiHand-Tracking //... | 39.056911 | 174 | 0.743963 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.