hexsha stringlengths 40 40 | size int64 3 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 972 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 3 972 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 3 972 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 3 1.03M | avg_line_length float64 1.13 941k | max_line_length int64 2 941k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
e3ef462471404137a56b1266f197564ddb0cd8c7 | 3,745 | py | Python | intersight/models/connector_event_channel_control_ref.py | ategaw-cisco/intersight-python | 9d6476620507281b1dc358e29ac452d56081bbb0 | [
"Apache-2.0"
] | null | null | null | intersight/models/connector_event_channel_control_ref.py | ategaw-cisco/intersight-python | 9d6476620507281b1dc358e29ac452d56081bbb0 | [
"Apache-2.0"
] | null | null | null | intersight/models/connector_event_channel_control_ref.py | ategaw-cisco/intersight-python | 9d6476620507281b1dc358e29ac452d56081bbb0 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Intersight REST API
This is Intersight REST API
OpenAPI spec version: 1.0.9-262
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
class ConnectorEventChannelControlRef(object):
"""
... | 24.966667 | 84 | 0.558077 |
2afa5a3b4e6a140c8e15930787dc5e676f7a0cc1 | 1,469 | py | Python | lib/layer_utils/test_proposal_layer_tf.py | sonnguyen64/horus-tf-faster-rcnn | 1322cb413932ef4d911e8ebc4ae93b24d58eb56b | [
"MIT"
] | null | null | null | lib/layer_utils/test_proposal_layer_tf.py | sonnguyen64/horus-tf-faster-rcnn | 1322cb413932ef4d911e8ebc4ae93b24d58eb56b | [
"MIT"
] | 1 | 2018-10-17T08:00:17.000Z | 2018-10-23T07:39:38.000Z | lib/layer_utils/test_proposal_layer_tf.py | sonnguyen64/horus-tf-faster-rcnn | 1322cb413932ef4d911e8ebc4ae93b24d58eb56b | [
"MIT"
] | null | null | null | import sys
sys.path.insert(0, 'lib')
import numpy as np
import tensorflow as tf
from proposal_layer_tf import proposal_layer_tf
test_file = 'proposal_layer_test/test1'
npz_file = np.load(test_file + '_input.npz')
rpn_cls_prob, rpn_bbox_pred, im_info, cfg_key, anchors, num_anchors = \
npz_file['rpn_cls_prob'], ... | 32.644444 | 79 | 0.70388 |
60d2612d2f0e0468af74131dbfbcf91760f7cc81 | 121 | py | Python | influxdb/__init__.py | bbinet/influxdb-python | 81793fa8fcb44edf2a753d93c4ba7bb23f88d2d5 | [
"MIT"
] | null | null | null | influxdb/__init__.py | bbinet/influxdb-python | 81793fa8fcb44edf2a753d93c4ba7bb23f88d2d5 | [
"MIT"
] | null | null | null | influxdb/__init__.py | bbinet/influxdb-python | 81793fa8fcb44edf2a753d93c4ba7bb23f88d2d5 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from influxdb.client import InfluxDBClient
__all__ = ['InfluxDBClient']
__version__ = '0.1.4'
| 15.125 | 42 | 0.68595 |
6660e5132ca3e94dea620d369cf22de02068d18f | 4,031 | py | Python | pytmpdir/DirectoryTest.py | Synerty/pytmpdir | 0c393f35b4aa3f5368527dcf1f9932dfc967c730 | [
"MIT"
] | null | null | null | pytmpdir/DirectoryTest.py | Synerty/pytmpdir | 0c393f35b4aa3f5368527dcf1f9932dfc967c730 | [
"MIT"
] | 2 | 2016-12-14T18:11:59.000Z | 2016-12-15T02:33:20.000Z | pytmpdir/DirectoryTest.py | Synerty/pytmpdir | 0c393f35b4aa3f5368527dcf1f9932dfc967c730 | [
"MIT"
] | null | null | null |
# Created by Synerty Pty Ltd
# Copyright (C) 2013-2017 Synerty Pty Ltd (Australia)
#
# This software is open source, the MIT license applies.
#
# Website : http://www.synerty.com
# Support : support@synerty.com
import os
import random
import string
import unittest
from tempfile import mkstemp
from pytmpdir.Directory... | 34.452991 | 77 | 0.57802 |
69604d4d412e7887da8cf83e7a98060b79bde148 | 617 | py | Python | tools.py | zhenv5/atp | 9b9a19283f13a9ab8f25688894a6ec23ccb73e9c | [
"BSD-3-Clause"
] | 7 | 2019-04-15T17:19:03.000Z | 2022-01-06T03:14:28.000Z | tools.py | DavidMcDonald1993/atp | baa7ba751b7be7306f624043989bf3ecde3148d4 | [
"BSD-3-Clause"
] | null | null | null | tools.py | DavidMcDonald1993/atp | baa7ba751b7be7306f624043989bf3ecde3148d4 | [
"BSD-3-Clause"
] | 2 | 2019-05-03T14:47:17.000Z | 2019-11-18T13:54:31.000Z | import os.path
def sprint(dir_name,file_name,line):
print line
with open(os.path.join(dir_name,file_name),"a") as f:
f.write("%s \n" % line)
def dir_tail_name(file_name):
import os.path
dir_name = os.path.dirname(os.path.abspath(file_name))
#dir_name = os.path.dirname(file_name)
head, tail = os.path.split(file... | 29.380952 | 69 | 0.719611 |
8235b2539443e778356dd25a4d99fc79becce705 | 2,401 | py | Python | archive/madison.py | jayktee/scrapers-us-municipal | ff52a331e91cb590a3eda7db6c688d75b77acacb | [
"MIT"
] | 67 | 2015-04-28T19:28:18.000Z | 2022-01-31T03:27:17.000Z | archive/madison.py | jayktee/scrapers-us-municipal | ff52a331e91cb590a3eda7db6c688d75b77acacb | [
"MIT"
] | 202 | 2015-01-15T18:43:12.000Z | 2021-11-23T15:09:10.000Z | archive/madison.py | jayktee/scrapers-us-municipal | ff52a331e91cb590a3eda7db6c688d75b77acacb | [
"MIT"
] | 54 | 2015-01-27T03:15:45.000Z | 2021-09-10T19:35:32.000Z | from pupa.scrape import Jurisdiction, Organization
from legistar.people import LegistarPersonScraper
class MadisonPersonScraper(LegistarPersonScraper):
EXTRA_FIELDS = ('notes',)
DATE_FORMATS = ('%m/%d/%Y', '%m/%d/%Y*',)
def skip_item(self, item):
#return item['name'] in ('VACANCIES', 'Al Matano'... | 37.515625 | 94 | 0.597668 |
51d25c0d66527fa15757400559a65406e23e5014 | 691 | py | Python | pipelines/programs/metaphlan.py | cdeitrick/workflows | 8edd2a08078144a2445af3903eb13b71abb96538 | [
"MIT"
] | null | null | null | pipelines/programs/metaphlan.py | cdeitrick/workflows | 8edd2a08078144a2445af3903eb13b71abb96538 | [
"MIT"
] | null | null | null | pipelines/programs/metaphlan.py | cdeitrick/workflows | 8edd2a08078144a2445af3903eb13b71abb96538 | [
"MIT"
] | null | null | null | from typing import List, Any
from pipelines import sampleio
from pathlib import Path
def run_metaphlan(samples: List[sampleio.SampleReads], output_folder: Path, bash: Path = None):
"""
Runs metaphlan over a series of samples.
Parameters
----------
samples
output_folder: Where to save the output
bash:Path Will ... | 28.791667 | 95 | 0.709117 |
e651b30d870b3a4c628637e915626f5e0d754957 | 1,398 | py | Python | nasa/client.py | quiktea/nasa.py | b5dce1a5c8930e6e3a95de41e3e5a5b3be36aa31 | [
"MIT"
] | 1 | 2021-04-24T22:30:25.000Z | 2021-04-24T22:30:25.000Z | nasa/client.py | quiktea/nasa.py | b5dce1a5c8930e6e3a95de41e3e5a5b3be36aa31 | [
"MIT"
] | null | null | null | nasa/client.py | quiktea/nasa.py | b5dce1a5c8930e6e3a95de41e3e5a5b3be36aa31 | [
"MIT"
] | null | null | null | from .http import *
from .models import *
from typing import Union, List
class Client:
def __init__(self, api_key : str = ""):
self._key = api_key
self.http = HTTPClient()
self.auth_params = {"api_key" : api_key}
self.http.login(api_key)
async def apod(self, date : str = None, ... | 36.789474 | 174 | 0.575823 |
80db824b1a39414e44aa8a38584b2e59d965c97c | 830 | py | Python | src/mold/plugins/face/github.py | felix-hilden/mold | f29b689673a158094196e3d853e61812c9957cb5 | [
"MIT"
] | 1 | 2021-04-13T11:08:59.000Z | 2021-04-13T11:08:59.000Z | src/mold/plugins/face/github.py | felix-hilden/mold | f29b689673a158094196e3d853e61812c9957cb5 | [
"MIT"
] | 1 | 2021-08-10T10:39:14.000Z | 2021-08-10T10:39:14.000Z | src/mold/plugins/face/github.py | felix-hilden/mold | f29b689673a158094196e3d853e61812c9957cb5 | [
"MIT"
] | null | null | null | from mold import Interface, Question, hook
from .vcs_host import interface as vcs_host, Provides as VcsHostNeeds
from ..domains import module
class Provides:
github_user: str = ''
github_repo: str = ''
class Accepts:
pass
questions = [
Question('github_user', 'GitHub user name', prefill=True),
... | 21.282051 | 80 | 0.693976 |
dcd6c15954e1ca9997cf48f67f1ed803f1a30ef3 | 94,385 | py | Python | src/olympia/blocklist/tests/test_admin.py | renuacpro/addons-server | 7435857d7fd709929caf6f260a580961a0643f4e | [
"BSD-3-Clause"
] | 1 | 2020-07-27T11:22:17.000Z | 2020-07-27T11:22:17.000Z | src/olympia/blocklist/tests/test_admin.py | renuacpro/addons-server | 7435857d7fd709929caf6f260a580961a0643f4e | [
"BSD-3-Clause"
] | null | null | null | src/olympia/blocklist/tests/test_admin.py | renuacpro/addons-server | 7435857d7fd709929caf6f260a580961a0643f4e | [
"BSD-3-Clause"
] | null | null | null | import datetime
import json
from unittest import mock
from django.conf import settings
from django.contrib.admin.models import LogEntry, ADDITION
from django.contrib.contenttypes.models import ContentType
from pyquery import PyQuery as pq
from waffle.testutils import override_switch
from olympia import amo
from oly... | 43.216575 | 79 | 0.617333 |
56cd833164f1101869b75cb9347944c31e1612af | 2,443 | py | Python | RoloDataset.py | JunwookHeo/YOLO-OT | 7004f25ce858acb7253bfcbc6fabeb915d8747a3 | [
"MIT"
] | null | null | null | RoloDataset.py | JunwookHeo/YOLO-OT | 7004f25ce858acb7253bfcbc6fabeb915d8747a3 | [
"MIT"
] | null | null | null | RoloDataset.py | JunwookHeo/YOLO-OT | 7004f25ce858acb7253bfcbc6fabeb915d8747a3 | [
"MIT"
] | null | null | null | import glob
import os
import torch
import numpy as np
from PIL import Image
from torch.utils.data import Dataset, DataLoader
from coord_utils import *
class RoloDataset(Dataset):
""" Loading frames in a video file """
def __init__(self, path, label, seq_num, img_size, mode):
self.path = path
s... | 33.013514 | 120 | 0.537863 |
763ee8b071afc36baaac3753be790860623594d0 | 4,390 | py | Python | apps/search/src/search/search_controller.py | lumanjiao/XLS_BigData | 2c4c37872b8636df1c8b0e005bc12a635a753c7a | [
"Apache-2.0"
] | 11 | 2019-03-20T07:38:35.000Z | 2021-06-18T09:42:46.000Z | apps/search/src/search/search_controller.py | lumanjiao/XLS_BigData | 2c4c37872b8636df1c8b0e005bc12a635a753c7a | [
"Apache-2.0"
] | null | null | null | apps/search/src/search/search_controller.py | lumanjiao/XLS_BigData | 2c4c37872b8636df1c8b0e005bc12a635a753c7a | [
"Apache-2.0"
] | 5 | 2019-06-29T03:13:02.000Z | 2020-04-23T04:47:11.000Z | #!/usr/bin/env python
# -- coding: utf-8 --
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (th... | 31.811594 | 128 | 0.687016 |
ba771970c2d7733bc06b9fd83c9056d431c41c25 | 2,543 | py | Python | sdk/python/pulumi_aws/ses/receipt_filter.py | lemonade-hq/pulumi-aws | 9ee22c65c7bad42d38b16879ccd56526d856a01a | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_aws/ses/receipt_filter.py | lemonade-hq/pulumi-aws | 9ee22c65c7bad42d38b16879ccd56526d856a01a | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_aws/ses/receipt_filter.py | lemonade-hq/pulumi-aws | 9ee22c65c7bad42d38b16879ccd56526d856a01a | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2021-03-08T15:05:29.000Z | 2021-03-08T15:05:29.000Z | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import json
import warnings
import pulumi
import pulumi.runtime
from .. import utilities, tables
class ReceiptFilter(pulumi.CustomReso... | 35.319444 | 118 | 0.653559 |
bfce8c7ffb20e934ee55807d12345860284cfd16 | 1,546 | py | Python | CURSO PYTHON UDEMY/Curso Udemy/Mundo 4 (POO)/98. Classes - Python Orientado a Objetos.py | nihilboy1455/CURSO-PYTHON-UDEMY | ef27b9bba12672f5426ddeeb3fd70304073a56e2 | [
"MIT"
] | null | null | null | CURSO PYTHON UDEMY/Curso Udemy/Mundo 4 (POO)/98. Classes - Python Orientado a Objetos.py | nihilboy1455/CURSO-PYTHON-UDEMY | ef27b9bba12672f5426ddeeb3fd70304073a56e2 | [
"MIT"
] | null | null | null | CURSO PYTHON UDEMY/Curso Udemy/Mundo 4 (POO)/98. Classes - Python Orientado a Objetos.py | nihilboy1455/CURSO-PYTHON-UDEMY | ef27b9bba12672f5426ddeeb3fd70304073a56e2 | [
"MIT"
] | null | null | null | from CLASSES98 import Pessoa, Pessoas1
'''
Quando eu estiver criando uma classe, eu devo entender ela realmente como um objeto real
capaz de executar ações, dai depois eu transformo isso em código
'''
a = Pessoa()
a.falar()
'''
Eu crio uma classe, e depois os atributos da classe.
depois eu posso abribuir a classe à u... | 33.608696 | 113 | 0.729625 |
0f97fab38cff023ab701eb3e7e51f9f286b78777 | 498 | py | Python | modules/cbflib/dREL-ply-0.5/drel_prep.py | jorgediazjr/dials-dev20191018 | 77d66c719b5746f37af51ad593e2941ed6fbba17 | [
"BSD-3-Clause"
] | null | null | null | modules/cbflib/dREL-ply-0.5/drel_prep.py | jorgediazjr/dials-dev20191018 | 77d66c719b5746f37af51ad593e2941ed6fbba17 | [
"BSD-3-Clause"
] | null | null | null | modules/cbflib/dREL-ply-0.5/drel_prep.py | jorgediazjr/dials-dev20191018 | 77d66c719b5746f37af51ad593e2941ed6fbba17 | [
"BSD-3-Clause"
] | 1 | 2020-02-04T15:39:06.000Z | 2020-02-04T15:39:06.000Z | #!/usr/bin/python
import sys
class Process:
def execute_method(self):
valuename = sys.argv[1]
editname = valuename + '_local'
print valuename
print editname
f = open("cbf_data_debug", "r")
data = f.readline()
str_list = []
while data:
data = f.readline()
print data
str = data.replace(valuen... | 18.444444 | 44 | 0.662651 |
5a700c1668d9dc20b736df38a547204a75d5e56e | 47,855 | py | Python | blink/biencoder/train_biencoder_mst.py | parin1995/claim2fact | 9f928a5789b3dc85cfa69395e0ba02b0b84276a8 | [
"MIT"
] | null | null | null | blink/biencoder/train_biencoder_mst.py | parin1995/claim2fact | 9f928a5789b3dc85cfa69395e0ba02b0b84276a8 | [
"MIT"
] | null | null | null | blink/biencoder/train_biencoder_mst.py | parin1995/claim2fact | 9f928a5789b3dc85cfa69395e0ba02b0b84276a8 | [
"MIT"
] | 1 | 2021-12-05T21:20:49.000Z | 2021-12-05T21:20:49.000Z | # Copyright (c) Facebook, Inc. and its affiliates.
# Copyright (c) 2021 Dhruv Agarwal and authors of arboEL.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
#
import os
import random
import time
import pickle5 as pickle
imp... | 55.132488 | 339 | 0.623738 |
b6ab59ed3564ca3a7ad61edeee95de68a4bf5444 | 21,002 | py | Python | mrjob/parse.py | Milstein/mrjob | 226a741548cf125ecfb549b7c50d52cda932d045 | [
"Apache-2.0"
] | 1 | 2015-02-22T00:12:25.000Z | 2015-02-22T00:12:25.000Z | mrjob/parse.py | kod3r/mrjob | 226a741548cf125ecfb549b7c50d52cda932d045 | [
"Apache-2.0"
] | 1 | 2021-03-26T00:47:44.000Z | 2021-03-26T00:47:44.000Z | mrjob/parse.py | Milstein/mrjob | 226a741548cf125ecfb549b7c50d52cda932d045 | [
"Apache-2.0"
] | null | null | null | # Copyright 2009-2012 Yelp
# Copyright 2013 Steve Johnson and David Marin
#
# 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... | 36.33564 | 313 | 0.647415 |
9b56d744011924eb4fad38203efc188143920323 | 107 | py | Python | Homework Examples/exam 2 figure 1.py | tonysulfaro/CSE-231 | 0e3ff5422fe42624a90a17d7f33174346662a6fc | [
"MIT"
] | 2 | 2021-09-23T19:17:24.000Z | 2021-11-29T09:03:56.000Z | Homework Examples/exam 2 figure 1.py | tonysulfaro/CSE-231 | 0e3ff5422fe42624a90a17d7f33174346662a6fc | [
"MIT"
] | null | null | null | Homework Examples/exam 2 figure 1.py | tonysulfaro/CSE-231 | 0e3ff5422fe42624a90a17d7f33174346662a6fc | [
"MIT"
] | 1 | 2020-10-25T13:03:18.000Z | 2020-10-25T13:03:18.000Z | import operator
x = {1: 2, 3: 4, 4: 3, 2: 1, 0: 0}
sorted_x = sorted(x.items(), key=operator.itemgetter(1)) | 35.666667 | 56 | 0.626168 |
60f9b66a69ab280ff7ad591e748aa57b3b83ae51 | 3,465 | py | Python | sfeprapy/dat/steel_section.py | fsepy/sfeprapy | 0b1c11b30034793e1231f599cf41e496a9ec56aa | [
"MIT"
] | 4 | 2021-04-11T00:57:43.000Z | 2022-03-10T05:28:48.000Z | sfeprapy/dat/steel_section.py | fsepy/sfeprapy | 0b1c11b30034793e1231f599cf41e496a9ec56aa | [
"MIT"
] | 3 | 2019-10-26T11:31:58.000Z | 2019-11-23T11:27:11.000Z | sfeprapy/dat/steel_section.py | fsepy/sfeprapy | 0b1c11b30034793e1231f599cf41e496a9ec56aa | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# AUTHOR: YAN FU
# DATE: 23/01/2018
# FILE NAME: steel_carbon.py
# DESCRIPTION: This python script file contains SteelSection object which transforms data stored within section_UB.csv
# to Python readable format. Details see description under the object.
import os
import pandas as ... | 26.052632 | 158 | 0.648196 |
8f59fc2b94df0666cb9a0248e835579c8c25b19e | 2,100 | py | Python | examples/two_file_example.py | ajnelson-nist/pySHACL | eebb546c981d5e7de72c8e51b0d9eaf14960e807 | [
"Apache-2.0"
] | 167 | 2018-09-05T11:28:28.000Z | 2022-03-29T13:31:02.000Z | examples/two_file_example.py | ajnelson-nist/pySHACL | eebb546c981d5e7de72c8e51b0d9eaf14960e807 | [
"Apache-2.0"
] | 123 | 2018-09-07T04:27:05.000Z | 2022-03-25T15:07:56.000Z | examples/two_file_example.py | ajnelson-nist/pySHACL | eebb546c981d5e7de72c8e51b0d9eaf14960e807 | [
"Apache-2.0"
] | 50 | 2018-09-14T11:12:31.000Z | 2022-03-25T15:00:21.000Z | from pyshacl import validate
shapes_file = '''
@prefix dash: <http://datashapes.org/dash#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix schema: <http://schema.org/> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix xsd: <http://www.... | 27.272727 | 75 | 0.568095 |
0aaf230a562cc087bf9b972208dd61337f9326d9 | 1,955 | py | Python | tests/adapters/model/sqlalchemy_model/sqlite/conftest.py | proteanhq/protean | 2006832265435cad8d4f9b86d1a789d8828d2707 | [
"BSD-3-Clause"
] | 6 | 2018-09-26T04:54:09.000Z | 2022-03-30T01:01:45.000Z | tests/adapters/model/sqlalchemy_model/sqlite/conftest.py | proteanhq/protean | 2006832265435cad8d4f9b86d1a789d8828d2707 | [
"BSD-3-Clause"
] | 261 | 2018-09-20T09:53:33.000Z | 2022-03-08T17:43:04.000Z | tests/adapters/model/sqlalchemy_model/sqlite/conftest.py | proteanhq/protean | 2006832265435cad8d4f9b86d1a789d8828d2707 | [
"BSD-3-Clause"
] | 6 | 2018-07-22T07:09:15.000Z | 2021-02-02T05:17:23.000Z | import os
import pytest
def initialize_domain():
from protean.domain import Domain
domain = Domain("SQLAlchemy Test - SQLite")
# Construct relative path to config file
current_path = os.path.abspath(os.path.dirname(__file__))
config_path = os.path.join(current_path, "./config.py")
if os.pa... | 27.928571 | 86 | 0.697187 |
2ee56e6ca01659646130cca08967c1cf57e1b16a | 377 | py | Python | app/api/all_countries.py | lucasmcast/COVID-19-api | 9de261b039d7eb9f46dad7aa140d2e3d4d77494a | [
"MIT"
] | 2 | 2020-03-27T22:59:47.000Z | 2021-01-05T21:16:24.000Z | app/api/all_countries.py | lucasmcast/COVID-19-api | 9de261b039d7eb9f46dad7aa140d2e3d4d77494a | [
"MIT"
] | null | null | null | app/api/all_countries.py | lucasmcast/COVID-19-api | 9de261b039d7eb9f46dad7aa140d2e3d4d77494a | [
"MIT"
] | 1 | 2021-01-06T13:40:13.000Z | 2021-01-06T13:40:13.000Z | from . import api
from flask import jsonify
from datetime import date
from ..models import GeneralsDatas, CountryCases
@api.route('/all_countries', methods=["GET"])
def all_countries():
date_now = str(date.today())
all_data = CountryCases.query.filter_by(date_data=date_now)
list_json = [data.to_json() for ... | 31.416667 | 63 | 0.737401 |
af13768eea0bb177fdd4f3caeb93ac5a2f3926a7 | 12,702 | py | Python | 2.PDF-ext/core.py | Coder-Pham/KPMG-Challenge | 18eea384ca046a59b2700c1b3b90325c442e5606 | [
"MIT"
] | null | null | null | 2.PDF-ext/core.py | Coder-Pham/KPMG-Challenge | 18eea384ca046a59b2700c1b3b90325c442e5606 | [
"MIT"
] | null | null | null | 2.PDF-ext/core.py | Coder-Pham/KPMG-Challenge | 18eea384ca046a59b2700c1b3b90325c442e5606 | [
"MIT"
] | null | null | null |
# coding: utf-8
# # Text Summarization in Python
#
# ## Approach:
# Extractive text summarization is all about finding the more important sentences from a document as a summary of that document.
# Our approach is using the PageRank algorithm to find these 'important' sentences.
# ## Implementation
# ### 1. Impor... | 33.514512 | 128 | 0.728389 |
2078fa93e263ffe8364bd83bf16475f397e1ef29 | 625 | py | Python | blog/wsgi.py | atlednolispe/blog | d3926e424d544f3e9a3805b16a15072ac6c6a780 | [
"MIT"
] | null | null | null | blog/wsgi.py | atlednolispe/blog | d3926e424d544f3e9a3805b16a15072ac6c6a780 | [
"MIT"
] | 7 | 2020-06-05T16:37:46.000Z | 2022-03-11T23:11:36.000Z | blog/wsgi.py | atlednolispe/blog | d3926e424d544f3e9a3805b16a15072ac6c6a780 | [
"MIT"
] | null | null | null | """
WSGI config for blog project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/2.0/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
try:
import mysqlclient
except Mo... | 24.038462 | 78 | 0.7664 |
c1594134a6d3d112e0cfab2731289ef28eaaf127 | 2,091 | py | Python | app/main/views.py | YomZsamora/Watchlist-Default | a9077abec95c15d8c9b9d17280fb9647e3573891 | [
"Unlicense"
] | null | null | null | app/main/views.py | YomZsamora/Watchlist-Default | a9077abec95c15d8c9b9d17280fb9647e3573891 | [
"Unlicense"
] | null | null | null | app/main/views.py | YomZsamora/Watchlist-Default | a9077abec95c15d8c9b9d17280fb9647e3573891 | [
"Unlicense"
] | null | null | null | from flask import render_template,request,redirect,url_for
from . import main
from ..requests import get_movies,get_movie,search_movie
from .forms import ReviewForm
from ..models import Review
# Views
@main.route('/')
def index():
'''
View root page function that returns the index page and its data
'''
... | 30.75 | 146 | 0.695839 |
aa1a659a57f27145c009a93aaf806738cf03fa1b | 4,223 | py | Python | tests/test_select.py | timgates42/goless | 3c8742fa0f94d0a365840aae404da4e8eaed9d71 | [
"Apache-2.0"
] | 266 | 2015-01-03T04:18:48.000Z | 2022-02-16T03:08:38.000Z | tests/test_select.py | timgates42/goless | 3c8742fa0f94d0a365840aae404da4e8eaed9d71 | [
"Apache-2.0"
] | 19 | 2015-03-06T11:04:53.000Z | 2021-06-09T15:08:57.000Z | tests/test_select.py | timgates42/goless | 3c8742fa0f94d0a365840aae404da4e8eaed9d71 | [
"Apache-2.0"
] | 20 | 2015-01-03T03:45:08.000Z | 2022-03-05T06:05:32.000Z | import goless
from goless.backends import current as be
from . import BaseTests
class RecvCaseTests(BaseTests):
chansize = 1
def setUp(self):
BaseTests.setUp(self)
self.ch = goless.chan(self.chansize)
self.ca = goless.rcase(self.ch)
def test_ready(self):
self.assertFalse(... | 28.727891 | 85 | 0.608809 |
fd3a160794559ee44ca04d6f744f8bbaf8972812 | 3,980 | py | Python | lib/surface/spanner/instances/update.py | google-cloud-sdk-unofficial/google-cloud-sdk | 2a48a04df14be46c8745050f98768e30474a1aac | [
"Apache-2.0"
] | 2 | 2019-11-10T09:17:07.000Z | 2019-12-18T13:44:08.000Z | lib/surface/spanner/instances/update.py | google-cloud-sdk-unofficial/google-cloud-sdk | 2a48a04df14be46c8745050f98768e30474a1aac | [
"Apache-2.0"
] | null | null | null | lib/surface/spanner/instances/update.py | google-cloud-sdk-unofficial/google-cloud-sdk | 2a48a04df14be46c8745050f98768e30474a1aac | [
"Apache-2.0"
] | 1 | 2020-07-25T01:40:19.000Z | 2020-07-25T01:40:19.000Z | # -*- coding: utf-8 -*- #
# Copyright 2018 Google LLC. 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 requir... | 33.728814 | 79 | 0.719095 |
99f4596d8c3b13cacdb7814de6e9da5b1ead1e1b | 1,150 | py | Python | add-sources.py | eugk/sumo-logic-scripts | bbdb92ce91a1bda0ef4fab94c61fafbc288073d2 | [
"MIT"
] | null | null | null | add-sources.py | eugk/sumo-logic-scripts | bbdb92ce91a1bda0ef4fab94c61fafbc288073d2 | [
"MIT"
] | null | null | null | add-sources.py | eugk/sumo-logic-scripts | bbdb92ce91a1bda0ef4fab94c61fafbc288073d2 | [
"MIT"
] | null | null | null | import json
import requests
import socket
import sys
import os
# List of API endpoints:
# https://service.us2.sumologic.com/help/Default.htm#Sumo_Logic_Endpoints.htm%3FTocPath%3DAPIs%7C_____1
API_URL = 'https://api.us2.sumologic.com/api/v1/collectors'
USER = os.environ['SL_ACCESSID']
PASS = os.environ['SL_ACCESSKEY']... | 33.823529 | 168 | 0.709565 |
8f5b62d63ce5471550fc90f2dbfc85f8193dfb51 | 1,408 | py | Python | z3/magic_sequence.py | Wikunia/hakank | 030bc928d2efe8dcbc5118bda3f8ae9575d0fd13 | [
"MIT"
] | 279 | 2015-01-10T09:55:35.000Z | 2022-03-28T02:34:03.000Z | z3/magic_sequence.py | Wikunia/hakank | 030bc928d2efe8dcbc5118bda3f8ae9575d0fd13 | [
"MIT"
] | 10 | 2017-10-05T15:48:50.000Z | 2021-09-20T12:06:52.000Z | z3/magic_sequence.py | Wikunia/hakank | 030bc928d2efe8dcbc5118bda3f8ae9575d0fd13 | [
"MIT"
] | 83 | 2015-01-20T03:44:00.000Z | 2022-03-13T23:53:06.000Z | #!/usr/bin/python -u
# -*- coding: latin-1 -*-
#
# Magic sequence problem in Z3
# http://www.dcs.st-and.ac.uk/~ianm/CSPLib/prob/prob019/spec.html
# """
# A magic sequence of length n is a sequence of integers x0 . . xn-1 between
# 0 and n-1, such that for all i in 0 to n-1, the number i occurs exactly xi
# times ... | 28.16 | 79 | 0.620739 |
4498398b861b5900b4b3947e76701bf9b51e3eb8 | 678 | py | Python | examples/a5_error_handling.py | leonh/pyelements | eb8f6fd948bf2272219d69aa8e43a86df79bb946 | [
"MIT"
] | null | null | null | examples/a5_error_handling.py | leonh/pyelements | eb8f6fd948bf2272219d69aa8e43a86df79bb946 | [
"MIT"
] | null | null | null | examples/a5_error_handling.py | leonh/pyelements | eb8f6fd948bf2272219d69aa8e43a86df79bb946 | [
"MIT"
] | null | null | null | try:
# Write your operations here
print(numbers)
except:
# If there is an error, the code in this block will be executed
# For example, here you can log the error details
print("An exception occured")
print("-----------------------------------")
try:
print(numbers)
except NameError:
prin... | 21.1875 | 67 | 0.569322 |
1ffad90bfc44b19c30a903c5888fbc2ea0d9e2e4 | 1,823 | py | Python | module3/matrix_massive_d.py | aspadm/labworks | 8b04a40656f0791b191e7e6a980c10afc77cd041 | [
"MIT"
] | null | null | null | module3/matrix_massive_d.py | aspadm/labworks | 8b04a40656f0791b191e7e6a980c10afc77cd041 | [
"MIT"
] | null | null | null | module3/matrix_massive_d.py | aspadm/labworks | 8b04a40656f0791b191e7e6a980c10afc77cd041 | [
"MIT"
] | null | null | null | #Шибанова Дарья ИУ7-12
#Определить первые отрицательные элементы каждой строки матрицы,
#запомнить их в массиве. Сложить эл-ты матрицы с индексом макс.эл-та массива.
#Напечатать матрицу, массив и индекс макс.эл-та.
#B - матрица
#A - массив
A = []
Str = int(input('Введите количество строк (не более 7): '))
El... | 30.383333 | 80 | 0.61492 |
43aeff7560761a53e690a2e55527d988a5193a00 | 3,829 | py | Python | pystol-ui/tests/test_base.py | pystol/pystol | 95dbff08a0a1448a9b3bcc847623b59761916086 | [
"Apache-2.0"
] | 17 | 2020-03-18T13:49:23.000Z | 2022-02-17T04:38:19.000Z | pystol-ui/tests/test_base.py | pystol/pystol | 95dbff08a0a1448a9b3bcc847623b59761916086 | [
"Apache-2.0"
] | 2 | 2021-05-18T07:44:34.000Z | 2021-10-07T13:49:57.000Z | pystol-ui/tests/test_base.py | pystol/pystol | 95dbff08a0a1448a9b3bcc847623b59761916086 | [
"Apache-2.0"
] | 44 | 2019-10-23T20:26:31.000Z | 2021-11-12T12:19:41.000Z | #!/usr/bin/env python
"""
Copyright 2019 Pystol (pystol.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
Unless required by applicable law or agre... | 24.703226 | 75 | 0.559154 |
83cee280dfb1dfd41965c8504e6a0275a0e6d103 | 119 | py | Python | django/tests/templates/base.html.py | roshanba/mangal | f7b428811dc07214009cc33f0beb665ead402038 | [
"bzip2-1.0.6",
"MIT"
] | null | null | null | django/tests/templates/base.html.py | roshanba/mangal | f7b428811dc07214009cc33f0beb665ead402038 | [
"bzip2-1.0.6",
"MIT"
] | null | null | null | django/tests/templates/base.html.py | roshanba/mangal | f7b428811dc07214009cc33f0beb665ead402038 | [
"bzip2-1.0.6",
"MIT"
] | null | null | null | XXXXXX
XXXXXXXXXXXXX
XXXXXX
XXXXXXXXXX XXXXXXXX XXXXXX BBBBB BBBBBBBBBBBBBXXXXX
BBBBB BBBBBBB
BBBBBBBB
XXXXXXX
XXXXXXX
| 13.222222 | 51 | 0.890756 |
0e106e25a7d0ce5296dcfd541465797a8f621962 | 2,574 | py | Python | TwitchGraph/TwitchBot.py | dmegahan/TwitchStats | 0f3964b74d4c4eb564d97c55984e52fe409254e7 | [
"Apache-2.0"
] | 1 | 2019-03-04T18:05:45.000Z | 2019-03-04T18:05:45.000Z | TwitchGraph/TwitchBot.py | dmegahan/TwitchStats | 0f3964b74d4c4eb564d97c55984e52fe409254e7 | [
"Apache-2.0"
] | null | null | null | TwitchGraph/TwitchBot.py | dmegahan/TwitchStats | 0f3964b74d4c4eb564d97c55984e52fe409254e7 | [
"Apache-2.0"
] | null | null | null | import requests
import csv
import threading
import time
import datetime
import os
import logging
import TwitchAPI
import config
logging.getLogger("requests").setLevel(logging.WARNING)
"""
This class tracks and records the twitch data from a stream (viewer numbers, game being played) and puts it into
a CSV fil... | 34.32 | 116 | 0.623543 |
9440313aa20cafe1c8d94fd226832cfd0a42bd7a | 32,696 | py | Python | crfnet/data_processing/generator/nuscenes_generator_modified.py | jovialio/CameraRadarFusionNet | 31b2550694fa80ac2a30bd81875a089eff684c9c | [
"Apache-2.0"
] | null | null | null | crfnet/data_processing/generator/nuscenes_generator_modified.py | jovialio/CameraRadarFusionNet | 31b2550694fa80ac2a30bd81875a089eff684c9c | [
"Apache-2.0"
] | null | null | null | crfnet/data_processing/generator/nuscenes_generator_modified.py | jovialio/CameraRadarFusionNet | 31b2550694fa80ac2a30bd81875a089eff684c9c | [
"Apache-2.0"
] | null | null | null | """
Copyright 2017-2018 Fellfalla (https://github.com/Fellfalla/)
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law o... | 40.972431 | 149 | 0.617354 |
68acccebfeb4ab6bb28cc2f928ce5deeaac989ab | 2,044 | py | Python | apps/site/tests/models/__init__.py | LocalGround/localground | aa5a956afe7a84a7763a3b23d62a9fd925831cd7 | [
"Apache-2.0"
] | 9 | 2015-05-29T22:22:20.000Z | 2022-02-01T20:39:00.000Z | apps/site/tests/models/__init__.py | LocalGround/localground | aa5a956afe7a84a7763a3b23d62a9fd925831cd7 | [
"Apache-2.0"
] | 143 | 2015-01-22T15:03:40.000Z | 2020-06-27T01:55:29.000Z | apps/site/tests/models/__init__.py | LocalGround/localground | aa5a956afe7a84a7763a3b23d62a9fd925831cd7 | [
"Apache-2.0"
] | 5 | 2015-03-16T20:51:49.000Z | 2017-02-07T20:48:49.000Z | # Abstract Classes:
from localground.apps.site.tests.models.abstract_base_tests import *
from localground.apps.site.tests.models.abstract_base_audit_tests import *
# Mixin Classes:
from localground.apps.site.tests.models.mixin_extents_tests import *
from localground.apps.site.tests.models.mixin_extras_tests import *
f... | 56.777778 | 78 | 0.844912 |
d77efe902ecf1a21594cb9af8304703a8ae3ceab | 1,834 | py | Python | src/ihcWrappers/odtcParamsXml.py | F9R/ihcpmslib-wrappers | 4a5e37ab2ecc8c8c1a8437992e45b9271ec18826 | [
"BSD-2-Clause"
] | 1 | 2022-02-09T06:41:20.000Z | 2022-02-09T06:41:20.000Z | src/ihcWrappers/odtcParamsXml.py | F9R/ihcpmslib-wrappers | 4a5e37ab2ecc8c8c1a8437992e45b9271ec18826 | [
"BSD-2-Clause"
] | null | null | null | src/ihcWrappers/odtcParamsXml.py | F9R/ihcpmslib-wrappers | 4a5e37ab2ecc8c8c1a8437992e45b9271ec18826 | [
"BSD-2-Clause"
] | null | null | null | import configparser
config = configparser.ConfigParser()
config.read('config.ini')
if config['IHC']['ODTC'] != "True":
pass
import clr
clr.AddReference("IHC_PMS_Lib.Odtc")
from IHC_PMS_Lib.Odtc import OdtcParamsXml
from IHC_PMS_Lib.Odtc.MethodXML import MethodSet
class OdtcParamsXmlWrapper:
def __init__(sel... | 27.787879 | 63 | 0.699564 |
36779b99e6f0e475db2a852c7beb25fd406b6236 | 786 | py | Python | historical_exercises/api-scripts.exercises/tools.py | mvdbeek/bioblend-tutorial | 4b5a254e05bbdc1c376eb4840167796374efce0e | [
"MIT"
] | 12 | 2015-07-07T13:24:55.000Z | 2020-07-18T19:03:45.000Z | historical_exercises/api-scripts.exercises/tools.py | mvdbeek/bioblend-tutorial | 4b5a254e05bbdc1c376eb4840167796374efce0e | [
"MIT"
] | 3 | 2015-11-01T20:54:05.000Z | 2020-07-15T18:48:16.000Z | historical_exercises/api-scripts.exercises/tools.py | mvdbeek/bioblend-tutorial | 4b5a254e05bbdc1c376eb4840167796374efce0e | [
"MIT"
] | 13 | 2015-07-06T08:27:22.000Z | 2021-05-28T13:08:04.000Z | #!/usr/bin/env python
import sys
import json
import output
import requests
BASE_URL = 'http://localhost:8080'
# -----------------------------------------------------------------------------
def list_tools():
#EXERCISE: build params and include 'in_panel' : False
return requests.get( full_url, params=params ... | 28.071429 | 81 | 0.53944 |
2907bba8f353e903b570ef54ff810a4d42343ccf | 1,277 | py | Python | build/lib/simpleimagededupe/deduper.py | RubberClucky/SIDD | 51e693946b5e71e315c4ca7dae0d8a9b8444fd21 | [
"MIT"
] | null | null | null | build/lib/simpleimagededupe/deduper.py | RubberClucky/SIDD | 51e693946b5e71e315c4ca7dae0d8a9b8444fd21 | [
"MIT"
] | 1 | 2022-03-07T00:13:01.000Z | 2022-03-07T00:13:01.000Z | build/lib/simpleimagededupe/deduper.py | RubberClucky/SIDD | 51e693946b5e71e315c4ca7dae0d8a9b8444fd21 | [
"MIT"
] | null | null | null | import cv2
import os
import alive_progress
def CompareImage(original, dupe) -> bool:
originalImg = cv2.imread(original)
dupeImg = cv2.imread(dupe)
if originalImg.shape[:2] == dupeImg.shape[:2]:
difference = cv2.subtract(originalImg, dupeImg)
b, g, r = cv2.split(difference)
if c... | 35.472222 | 96 | 0.584965 |
55a8224b96922d317963eb09e19c0d4868f43353 | 4,156 | py | Python | s4_random_forest.py | BillChan226/In-Field-Crop-Disease-Regnition-via-Domain-Adaptation | 4500e7149a51eab66778471750b84b09d415e578 | [
"MIT"
] | 1 | 2021-12-23T17:56:22.000Z | 2021-12-23T17:56:22.000Z | s4_random_forest.py | BillChan226/In-Field-Crop-Disease-Regnition-via-Domain-Adaptation | 4500e7149a51eab66778471750b84b09d415e578 | [
"MIT"
] | null | null | null | s4_random_forest.py | BillChan226/In-Field-Crop-Disease-Regnition-via-Domain-Adaptation | 4500e7149a51eab66778471750b84b09d415e578 | [
"MIT"
] | null | null | null |
import numpy as np
import skimage.io
from sklearn import svm
import os
# read data
train_path = '.\\data\\train'
test_path = '.\\data\\test'
#%% train data
train_data = []
train_label = []
for x in os.listdir(os.path.join(train_path, 'img')):
img_path = os.path.join(train_path, 'img', x)
ano_path = os.path.j... | 25.813665 | 84 | 0.615014 |
d7936dc8974beb7400be232170976c12da20fea8 | 10,223 | py | Python | montlake/plotting/flasso.py | sjkoelle/montlake | b908a43e0c00763bd1cf86120eaa6bdf7d8d1196 | [
"Apache-2.0"
] | 8 | 2021-11-24T19:39:24.000Z | 2021-12-03T01:30:14.000Z | montlake/plotting/flasso.py | sjkoelle/montlake | b908a43e0c00763bd1cf86120eaa6bdf7d8d1196 | [
"Apache-2.0"
] | null | null | null | montlake/plotting/flasso.py | sjkoelle/montlake | b908a43e0c00763bd1cf86120eaa6bdf7d8d1196 | [
"Apache-2.0"
] | null | null | null | # AUTOGENERATED! DO NOT EDIT! File to edit: nbs/plotting.flasso.ipynb (unless otherwise specified).
__all__ = ['width', 'plot_cos_boxes', 'plot_reg_path_ax_lambdasearch_customcolors_names',
'plot_reg_path_ax_lambdasearch_customcolors_tslasso', 'plot_reg_path_ax_lambdasearch_customcolors_norm',
'p... | 36.641577 | 130 | 0.579575 |
b2de00cacc8ea90e298aa46982bdf1a4bab4b5ae | 3,125 | py | Python | src/mp_api/core/models.py | munrojm/api | 478eb7b7d65ee72c65c9c3a61aec02aed7aa5ffe | [
"BSD-3-Clause-LBNL"
] | null | null | null | src/mp_api/core/models.py | munrojm/api | 478eb7b7d65ee72c65c9c3a61aec02aed7aa5ffe | [
"BSD-3-Clause-LBNL"
] | null | null | null | src/mp_api/core/models.py | munrojm/api | 478eb7b7d65ee72c65c9c3a61aec02aed7aa5ffe | [
"BSD-3-Clause-LBNL"
] | null | null | null | from typing import Dict, List, Optional, Union, Tuple
from pydantic import BaseModel, Field
from pymatgen import Element
Vector3D = Tuple[float, float, float]
class Lattice(BaseModel):
"""
A lattice object represented as a 3x3 matrix of floats in Angstroms
"""
a: float = Field(..., title="*a* latti... | 32.216495 | 83 | 0.6784 |
1e7dec77fd6ca6c217f4558ba020e0cf37099357 | 3,124 | py | Python | Lib/site-packages/prompt_toolkit/input/posix_pipe.py | edupyter/EDUPYTER38 | 396183cea72987506f1ef647c0272a2577c56218 | [
"bzip2-1.0.6"
] | 4,028 | 2015-01-02T16:31:38.000Z | 2018-10-25T14:51:02.000Z | Lib/site-packages/prompt_toolkit/input/posix_pipe.py | edupyter/EDUPYTER38 | 396183cea72987506f1ef647c0272a2577c56218 | [
"bzip2-1.0.6"
] | 688 | 2015-01-02T18:02:49.000Z | 2018-10-25T19:57:02.000Z | Lib/site-packages/prompt_toolkit/input/posix_pipe.py | edupyter/EDUPYTER38 | 396183cea72987506f1ef647c0272a2577c56218 | [
"bzip2-1.0.6"
] | 375 | 2015-01-02T17:57:09.000Z | 2018-10-23T09:52:01.000Z | import sys
assert sys.platform != "win32"
import os
from contextlib import contextmanager
from typing import ContextManager, Iterator, TextIO, cast
from ..utils import DummyContext
from .base import PipeInput
from .vt100 import Vt100Input
__all__ = [
"PosixPipeInput",
]
class _Pipe:
"Wrapper around os.pip... | 26.700855 | 79 | 0.611076 |
789899f8b411ad8b89428f46a7f558963db5746f | 4,048 | py | Python | third_party/pyjson5/src/json5/fakes/host_fake.py | frontend-arch/devtools-frontend | 907a14259687036ceac26b301d4fc9965327ec11 | [
"BSD-3-Clause"
] | 14,668 | 2015-01-01T01:57:10.000Z | 2022-03-31T23:33:32.000Z | third_party/pyjson5/src/json5/fakes/host_fake.py | frontend-arch/devtools-frontend | 907a14259687036ceac26b301d4fc9965327ec11 | [
"BSD-3-Clause"
] | 395 | 2020-04-18T08:22:18.000Z | 2021-12-08T13:04:49.000Z | third_party/pyjson5/src/json5/fakes/host_fake.py | frontend-arch/devtools-frontend | 907a14259687036ceac26b301d4fc9965327ec11 | [
"BSD-3-Clause"
] | 5,941 | 2015-01-02T11:32:21.000Z | 2022-03-31T16:35:46.000Z | # Copyright 2014 Dirk Pranke. 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... | 29.333333 | 79 | 0.565217 |
b51708ec1baadd97e53fc844fdb9e95af9d04a21 | 1,819 | py | Python | TelegramEDT/__init__.py | flifloo/TelegramEDT | 299dc340af31c4f7e6c601f133a5c10d6396225f | [
"MIT"
] | 1 | 2019-09-19T08:06:13.000Z | 2019-09-19T08:06:13.000Z | TelegramEDT/__init__.py | flifloo/TelegramEDT | 299dc340af31c4f7e6c601f133a5c10d6396225f | [
"MIT"
] | 11 | 2019-09-20T10:27:30.000Z | 2021-09-08T01:19:58.000Z | TelegramEDT/__init__.py | flifloo/TelegramEDT | 299dc340af31c4f7e6c601f133a5c10d6396225f | [
"MIT"
] | null | null | null | from os.path import isfile
from threading import RLock
from aiogram import Bot, Dispatcher, types
from aiogram.types import reply_keyboard
from aiogram.utils.callback_data import CallbackData
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from TelegramEDT.EDTcalendar import Calendar
from... | 32.482143 | 77 | 0.707532 |
5bf77d901db74a275741c2c8d2f296f1d96f4ba9 | 10,025 | py | Python | spikeinterface/sortingcomponents/motion_correction.py | vncntprvst/spikeinterface | dd5ae94f85fe5d9082b45321d2c96ba316eb4b77 | [
"MIT"
] | null | null | null | spikeinterface/sortingcomponents/motion_correction.py | vncntprvst/spikeinterface | dd5ae94f85fe5d9082b45321d2c96ba316eb4b77 | [
"MIT"
] | null | null | null | spikeinterface/sortingcomponents/motion_correction.py | vncntprvst/spikeinterface | dd5ae94f85fe5d9082b45321d2c96ba316eb4b77 | [
"MIT"
] | null | null | null | import numpy as np
import scipy.interpolate
import sklearn
from tqdm import tqdm
import sklearn.metrics
from spikeinterface.toolkit.preprocessing.basepreprocessor import BasePreprocessor, BasePreprocessorSegment
try:
import numba
HAVE_NUMBA = True
except ImportError:
HAVE_NUMBA = False
def correct_moti... | 39.940239 | 118 | 0.641895 |
5af480448f276f73f5317c140796b3de50fa1a25 | 1,927 | py | Python | var/spack/repos/builtin/packages/openfdtd/package.py | xiki-tempula/spack | 9d66c05e93ab8a933fc59915040c0e0c86a4aac4 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 9 | 2018-04-18T07:51:40.000Z | 2021-09-10T03:56:57.000Z | var/spack/repos/builtin/packages/openfdtd/package.py | xiki-tempula/spack | 9d66c05e93ab8a933fc59915040c0e0c86a4aac4 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 907 | 2018-04-18T11:17:57.000Z | 2022-03-31T13:20:25.000Z | var/spack/repos/builtin/packages/openfdtd/package.py | xiki-tempula/spack | 9d66c05e93ab8a933fc59915040c0e0c86a4aac4 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 29 | 2018-11-05T16:14:23.000Z | 2022-02-03T16:07:09.000Z | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Openfdtd(MakefilePackage):
"""OpenFDTD is general purpose FDTD simulator applicable to a w... | 38.54 | 95 | 0.662688 |
c3ed351e0ec67471c6f4b0f7b878d2fd282b074d | 5,658 | py | Python | src/datadog_api_client/v1/model/widget_message_display.py | DataDog/datadog-api-client-python | de2fc57dbde9acf4b8c8eef94ac29911227a62a2 | [
"Apache-2.0"
] | 32 | 2021-01-07T15:09:56.000Z | 2022-01-30T05:49:23.000Z | src/datadog_api_client/v1/model/widget_message_display.py | DataDog/datadog-api-client-python | de2fc57dbde9acf4b8c8eef94ac29911227a62a2 | [
"Apache-2.0"
] | 228 | 2020-09-03T14:03:54.000Z | 2022-03-31T20:16:12.000Z | src/datadog_api_client/v1/model/widget_message_display.py | DataDog/datadog-api-client-python | de2fc57dbde9acf4b8c8eef94ac29911227a62a2 | [
"Apache-2.0"
] | 12 | 2020-09-15T21:36:03.000Z | 2022-03-31T17:13:17.000Z | # Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
# This product includes software developed at Datadog (https://www.datadoghq.com/).
# Copyright 2019-Present Datadog, Inc.
from datadog_api_client.v1.model_utils import ( # noqa: F401
ApiTypeError,
Mo... | 39.84507 | 131 | 0.574585 |
9a5ac0ca820454f3b00e9c7e0c414878f182d202 | 5,356 | py | Python | idunn/datasources/wikipedia.py | Qwant/idunn | 65582dfed732093778bf7c2998db1e2cd78255b8 | [
"Apache-2.0"
] | 3 | 2021-10-07T20:07:57.000Z | 2022-03-04T15:23:26.000Z | idunn/datasources/wikipedia.py | Qwant/idunn | 65582dfed732093778bf7c2998db1e2cd78255b8 | [
"Apache-2.0"
] | 16 | 2021-02-01T11:02:03.000Z | 2022-03-23T14:44:50.000Z | idunn/datasources/wikipedia.py | Qwant/idunn | 65582dfed732093778bf7c2998db1e2cd78255b8 | [
"Apache-2.0"
] | null | null | null | import logging
import requests
import pybreaker
from requests.exceptions import HTTPError, RequestException, Timeout
from redis import RedisError
from idunn import settings
from idunn.utils import prometheus
from idunn.utils.redis import RedisWrapper
from idunn.utils.circuit_breaker import IdunnCircuitBreaker
from idu... | 37.454545 | 97 | 0.573936 |
87a0d10aa1f72e12a6c8456ea0745558653cdf70 | 126 | py | Python | EixampleEnergy/tool.py | TugdualSarazin/eixample_energy | bcda0ba0d51eb229f00f6c557c6680cd416a62a4 | [
"Apache-2.0"
] | null | null | null | EixampleEnergy/tool.py | TugdualSarazin/eixample_energy | bcda0ba0d51eb229f00f6c557c6680cd416a62a4 | [
"Apache-2.0"
] | null | null | null | EixampleEnergy/tool.py | TugdualSarazin/eixample_energy | bcda0ba0d51eb229f00f6c557c6680cd416a62a4 | [
"Apache-2.0"
] | null | null | null | import geopandas
def load_shapefile(shape_file_path, rows=None):
return geopandas.read_file(shape_file_path, rows=rows)
| 21 | 58 | 0.809524 |
cea6eaa332dc7b211cd3d554a10018990205bbb2 | 1,312 | py | Python | ravens/environments/environment_test.py | EricCousineau-TRI/ravens | d7f9db3214ed730c6d16e5c248684688555c6d23 | [
"Apache-2.0"
] | null | null | null | ravens/environments/environment_test.py | EricCousineau-TRI/ravens | d7f9db3214ed730c6d16e5c248684688555c6d23 | [
"Apache-2.0"
] | null | null | null | ravens/environments/environment_test.py | EricCousineau-TRI/ravens | d7f9db3214ed730c6d16e5c248684688555c6d23 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2020 The Ravens Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 27.914894 | 74 | 0.719512 |
fc6498d787c68f10dd37a30e4796911973e4bafc | 4,956 | py | Python | lib/utils/pvnet/pvnet_pose_utils.py | jonashein/pvnet_baseline | f919b5451051dbc5088f735271fc8779712b546c | [
"Apache-2.0"
] | null | null | null | lib/utils/pvnet/pvnet_pose_utils.py | jonashein/pvnet_baseline | f919b5451051dbc5088f735271fc8779712b546c | [
"Apache-2.0"
] | null | null | null | lib/utils/pvnet/pvnet_pose_utils.py | jonashein/pvnet_baseline | f919b5451051dbc5088f735271fc8779712b546c | [
"Apache-2.0"
] | null | null | null | import numpy as np
import cv2
from scipy.linalg import sqrtm
from scipy.optimize import leastsq
def pnp(points_3d, points_2d, camera_matrix, method=cv2.SOLVEPNP_EPNP):
try:
dist_coeffs = pnp.dist_coeffs
except:
dist_coeffs = np.zeros(shape=[8, 1], dtype='float64')
assert points_3d.shape[0]... | 37.545455 | 112 | 0.589185 |
b5fe7d9fc360b6a75bd7f628323b896419931788 | 6,727 | py | Python | server/external/youtube-dl/youtube_dl/extractor/adultswim.py | yycc179/urlp | d272b74c4aed18f03ccada8817ecf5c572a1bf71 | [
"MIT"
] | null | null | null | server/external/youtube-dl/youtube_dl/extractor/adultswim.py | yycc179/urlp | d272b74c4aed18f03ccada8817ecf5c572a1bf71 | [
"MIT"
] | null | null | null | server/external/youtube-dl/youtube_dl/extractor/adultswim.py | yycc179/urlp | d272b74c4aed18f03ccada8817ecf5c572a1bf71 | [
"MIT"
] | null | null | null | # coding: utf-8
from __future__ import unicode_literals
import re
from .turner import TurnerBaseIE
from ..utils import (
int_or_none,
strip_or_none,
)
class AdultSwimIE(TurnerBaseIE):
_VALID_URL = r'https?://(?:www\.)?adultswim\.com/videos/(?P<show_path>[^/?#]+)(?:/(?P<episode_path>[^/?#]+)... | 42.04375 | 191 | 0.523562 |
3c88f641711919d27c353723f2056e83740be812 | 31,218 | py | Python | theano/tensor/type.py | mdda/Theano | 6ca7b2b65000e371f009b617d41bc5a90f022d38 | [
"BSD-3-Clause"
] | 295 | 2015-09-25T21:15:04.000Z | 2022-01-13T01:16:18.000Z | libs/Theano/theano/tensor/type.py | shenshenzhanzhan/attention-lvcsr | 598d487c118e66875fdd625baa84ed29d283b800 | [
"MIT"
] | 21 | 2015-10-28T19:06:32.000Z | 2022-03-11T23:13:05.000Z | libs/Theano/theano/tensor/type.py | shenshenzhanzhan/attention-lvcsr | 598d487c118e66875fdd625baa84ed29d283b800 | [
"MIT"
] | 114 | 2015-09-26T21:23:02.000Z | 2021-11-19T02:36:41.000Z | import logging
import warnings
import numpy
import theano
from theano import config
from theano.gof import hashtype, Type, Variable
from theano import scalar as scal
_logger = logging.getLogger("theano.tensor.type")
class TensorType(Type):
"""
Symbolic `Type` representing a numpy.ndarray value.
Initia... | 37.885922 | 96 | 0.519924 |
c283f877414182dbcd9c39ce1c4235bd841b845a | 986 | py | Python | Basic programs of Socket Programming/connecting_to_google.py | kampaitees/Accessing-other-s-systems-using-Socket-Programming | b17ddc440c0ff79b3cbb992f404d24d3f57c9513 | [
"MIT"
] | 1 | 2019-10-04T22:46:39.000Z | 2019-10-04T22:46:39.000Z | Basic programs of Socket Programming/connecting_to_google.py | kampaitees/Accessing-other-s-systems-using-Socket-Programming | b17ddc440c0ff79b3cbb992f404d24d3f57c9513 | [
"MIT"
] | null | null | null | Basic programs of Socket Programming/connecting_to_google.py | kampaitees/Accessing-other-s-systems-using-Socket-Programming | b17ddc440c0ff79b3cbb992f404d24d3f57c9513 | [
"MIT"
] | null | null | null | import sys
import socket
#AF_INET reprsents that we are going to use IPv4version of Internet Protocol
#SOCK_STREAMrepresent that we are using TCP/IP as a Internet Protocol instead of UDP
try:
#creating the socket with IPv4 version and TCP as protocol in transport layer
s = socket.socket(socket.AF_IN... | 29.878788 | 85 | 0.729209 |
059cc0a0e54e47a29f9076d7e5992325aa6281d7 | 10,464 | py | Python | data_processing/ssmi_proc/bytemaps.py | jkcm/mesoscale-morphology | 7ee3f97d880878659ba2acb0418b53569b54ccb9 | [
"MIT"
] | null | null | null | data_processing/ssmi_proc/bytemaps.py | jkcm/mesoscale-morphology | 7ee3f97d880878659ba2acb0418b53569b54ccb9 | [
"MIT"
] | null | null | null | data_processing/ssmi_proc/bytemaps.py | jkcm/mesoscale-morphology | 7ee3f97d880878659ba2acb0418b53569b54ccb9 | [
"MIT"
] | null | null | null | """ Module for reading and verifying RSS gridded binary data files. """
import copy
import decimal
import gzip
import numpy as np
import sys
from collections import namedtuple
from collections import OrderedDict
from operator import mul
from functools import reduce
class Dataset:
""" Base class ... | 32.598131 | 77 | 0.620795 |
f33f1cb38f719519d070579791ae5b08cc179785 | 17,879 | py | Python | pi_software/robot_libs/ukmarsey_commands.py | robzed/pizero_for_ukmarsbot | 331998e245cfd01ce6a5c72b54b3438965642942 | [
"MIT"
] | null | null | null | pi_software/robot_libs/ukmarsey_commands.py | robzed/pizero_for_ukmarsbot | 331998e245cfd01ce6a5c72b54b3438965642942 | [
"MIT"
] | null | null | null | pi_software/robot_libs/ukmarsey_commands.py | robzed/pizero_for_ukmarsbot | 331998e245cfd01ce6a5c72b54b3438965642942 | [
"MIT"
] | 1 | 2021-02-05T13:41:49.000Z | 2021-02-05T13:41:49.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
""" Main Control file for UKMarsBot Robot with an Arduino Nano co-processor.
Intended to run on a Raspberry Pi on the actual robot.
"""
#
# Copyright (c) 2020/2021 Rob Probin.
# (Some items taken from Vison2/Dizzy platform 2016)
# All original work.
#
#... | 33.048059 | 102 | 0.607752 |
f0582bc3db26e7b7d061153b310b0960a7a54436 | 1,063 | py | Python | checkov/kubernetes/checks/MemoryRequests.py | niradler/checkov | 2628c6f28a5604efe3877d6eacc3044d2b66b7b1 | [
"Apache-2.0"
] | 4,013 | 2019-12-09T13:16:54.000Z | 2022-03-31T14:31:01.000Z | checkov/kubernetes/checks/MemoryRequests.py | niradler/checkov | 2628c6f28a5604efe3877d6eacc3044d2b66b7b1 | [
"Apache-2.0"
] | 1,258 | 2019-12-17T09:55:51.000Z | 2022-03-31T19:17:17.000Z | checkov/kubernetes/checks/MemoryRequests.py | niradler/checkov | 2628c6f28a5604efe3877d6eacc3044d2b66b7b1 | [
"Apache-2.0"
] | 638 | 2019-12-19T08:57:38.000Z | 2022-03-30T21:38:37.000Z | from checkov.common.models.enums import CheckCategories, CheckResult
from checkov.kubernetes.base_spec_check import BaseK8Check
class MemoryRequests(BaseK8Check):
def __init__(self):
name = "Memory requests should be set"
id = "CKV_K8S_12"
# Location: container .resources.requests.memory
... | 34.290323 | 100 | 0.647225 |
dda84532c342642fc023a85e1532102c3c07899c | 1,737 | py | Python | sinfo/perifericos/forms.py | webdesigncuba/Sinfo | 15998b43057b0c0f13083a3017f27740c64239bf | [
"MIT"
] | null | null | null | sinfo/perifericos/forms.py | webdesigncuba/Sinfo | 15998b43057b0c0f13083a3017f27740c64239bf | [
"MIT"
] | null | null | null | sinfo/perifericos/forms.py | webdesigncuba/Sinfo | 15998b43057b0c0f13083a3017f27740c64239bf | [
"MIT"
] | null | null | null | #
# Created on Sat Dec 25 2021
#
# The MIT License (MIT)
# Copyright (c) 2021 David Cordero Rosales
#
# 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 li... | 36.957447 | 122 | 0.701209 |
605b7b28579bafd1a73be6653b257c74c41c7b59 | 627 | py | Python | backpack.py | tauhid61/pandas_basic | 45c4b7a797a98b73319dfeda8a21f8d4725de382 | [
"Apache-2.0"
] | null | null | null | backpack.py | tauhid61/pandas_basic | 45c4b7a797a98b73319dfeda8a21f8d4725de382 | [
"Apache-2.0"
] | null | null | null | backpack.py | tauhid61/pandas_basic | 45c4b7a797a98b73319dfeda8a21f8d4725de382 | [
"Apache-2.0"
] | null | null | null | #Copied a dataframe from lecture video
#pasted the unformatted text in a text file
#Using this py script, formatted the text , and written into 'backpack.csv file'
import csv
list_word = [['Item', 'Category', 'Quantity', 'Weight (oz.)']]
handler = open('backpack.txt')
for line in handler:
word = line.rstri... | 28.5 | 81 | 0.676236 |
03ed96dc30f2ff4d2a5921225a50a9779f2095f1 | 418 | py | Python | 001.py | evdeev/Project-Euler-Solutions | 7a5d359435b78bbf4745320186fbfd0f78f6e128 | [
"MIT"
] | null | null | null | 001.py | evdeev/Project-Euler-Solutions | 7a5d359435b78bbf4745320186fbfd0f78f6e128 | [
"MIT"
] | null | null | null | 001.py | evdeev/Project-Euler-Solutions | 7a5d359435b78bbf4745320186fbfd0f78f6e128 | [
"MIT"
] | null | null | null | # Problem 1
# Multiples of 3 and 5
# If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9.
# The sum of these multiples is 23. Find the sum of all the multiples of 3 or 5 below 1000.
count = 0
for x in range(1000):
if (not x % 3) or (not x % 5):
count += x
# Альте... | 34.833333 | 97 | 0.650718 |
3f554887adbad2e3252414008c7a17abb6477c33 | 44,830 | py | Python | lib/ruyaml/representer.py | pycontribs/ruamel-yaml | ecbfde4ed6fa69017c7630b0983376c5ad1c2fd2 | [
"MIT"
] | 7 | 2020-02-01T10:07:10.000Z | 2020-07-19T14:33:36.000Z | lib/ruyaml/representer.py | pycontribs/ruamel-yaml | ecbfde4ed6fa69017c7630b0983376c5ad1c2fd2 | [
"MIT"
] | 4 | 2020-02-01T10:15:06.000Z | 2020-07-19T19:31:20.000Z | lib/ruyaml/representer.py | pycontribs/ruamel-yaml | ecbfde4ed6fa69017c7630b0983376c5ad1c2fd2 | [
"MIT"
] | 3 | 2020-04-22T10:38:34.000Z | 2020-07-19T13:56:25.000Z | # coding: utf-8
import base64
import copyreg
import datetime
import types
from collections import OrderedDict
from ruyaml.anchor import Anchor
from ruyaml.comments import (
CommentedKeyMap,
CommentedKeySeq,
CommentedMap,
CommentedOrderedMap,
CommentedSeq,
CommentedSet,
TaggedScalar,
co... | 37.420701 | 97 | 0.575954 |
eccc47124e3469aebabdff649ac02d5565d5b056 | 7,502 | py | Python | numpy/distutils/tests/test_exec_command.py | chatcannon/numpy | f1b3f00f7abdd97d59dc5b1c0bb922a692452736 | [
"BSD-3-Clause"
] | 1 | 2017-10-27T17:10:40.000Z | 2017-10-27T17:10:40.000Z | numpy/distutils/tests/test_exec_command.py | chatcannon/numpy | f1b3f00f7abdd97d59dc5b1c0bb922a692452736 | [
"BSD-3-Clause"
] | 1 | 2015-06-22T21:15:24.000Z | 2015-06-22T21:23:53.000Z | numpy/distutils/tests/test_exec_command.py | chatcannon/numpy | f1b3f00f7abdd97d59dc5b1c0bb922a692452736 | [
"BSD-3-Clause"
] | 1 | 2018-11-15T19:41:09.000Z | 2018-11-15T19:41:09.000Z | from __future__ import division, absolute_import, print_function
import os
import sys
from tempfile import TemporaryFile
from numpy.distutils import exec_command
from numpy.distutils.exec_command import get_pythonexe
from numpy.testing import TestCase, run_module_suite, tempdir
# In python 3 stdout, stderr are text ... | 34.1 | 79 | 0.580645 |
2cd52dafc50a4afbd1fe46317f4d382ab1297fa0 | 9,096 | py | Python | lasagne/layers/dense.py | huangshunliang/Lasagne_h | 359ea1b9f12678c3523c0cb100f646528d49df9e | [
"MIT"
] | 3,986 | 2015-04-09T17:00:42.000Z | 2022-03-30T08:21:55.000Z | lasagne/layers/dense.py | huangshunliang/Lasagne_h | 359ea1b9f12678c3523c0cb100f646528d49df9e | [
"MIT"
] | 736 | 2015-04-09T16:23:00.000Z | 2021-01-02T01:35:45.000Z | lasagne/layers/dense.py | huangshunliang/Lasagne_h | 359ea1b9f12678c3523c0cb100f646528d49df9e | [
"MIT"
] | 1,311 | 2015-04-09T17:05:38.000Z | 2022-03-27T03:41:01.000Z | import numpy as np
import theano.tensor as T
from .. import init
from .. import nonlinearities
from .base import Layer
__all__ = [
"DenseLayer",
"NINLayer",
]
class DenseLayer(Layer):
"""
lasagne.layers.DenseLayer(incoming, num_units,
W=lasagne.init.GlorotUniform(), b=lasagne.init.Constant(0.)... | 40.070485 | 79 | 0.633575 |
3b8a105f2a49bb0ecfafac09a6b536b8a1585d99 | 2,767 | py | Python | macro.py | heegong/auto_mouse_python | bbef6b09783d952d72c1026b2c114675296e4683 | [
"MIT"
] | 1 | 2020-12-09T12:36:25.000Z | 2020-12-09T12:36:25.000Z | macro.py | heegong/auto_mouse_python | bbef6b09783d952d72c1026b2c114675296e4683 | [
"MIT"
] | null | null | null | macro.py | heegong/auto_mouse_python | bbef6b09783d952d72c1026b2c114675296e4683 | [
"MIT"
] | null | null | null | import pyautogui as pa
import os
import time
ls2 = []
while True:
count = 0
ls = []
choose = int(input("1. 마우스 위치 등록, 2. 마우스 현재 위치 확인, 3. 매크로 시작 4. 등록된 매크로 보기\n>>> "))
if choose == 1:
position_x = int(input("x 좌표 : "))
position_y = int(input("y 좌표 : "))
ls.append(position_x)
... | 28.234694 | 87 | 0.428984 |
f344faaed6efdb55380a728e18b9884b9e5e2388 | 639 | py | Python | cisco_umbrella_enforcement/setup.py | xhennessy-r7/insightconnect-plugins | 59268051313d67735b5dd3a30222eccb92aca8e9 | [
"MIT"
] | null | null | null | cisco_umbrella_enforcement/setup.py | xhennessy-r7/insightconnect-plugins | 59268051313d67735b5dd3a30222eccb92aca8e9 | [
"MIT"
] | null | null | null | cisco_umbrella_enforcement/setup.py | xhennessy-r7/insightconnect-plugins | 59268051313d67735b5dd3a30222eccb92aca8e9 | [
"MIT"
] | null | null | null | # GENERATED BY KOMAND SDK - DO NOT EDIT
from setuptools import setup, find_packages
setup(name='cisco_umbrella_enforcement-rapid7-plugin',
version='1.0.0',
description='Cisco Umbrella Enforcement give technology partners the ability to send security events from their platform/service/appliance within a cu... | 42.6 | 220 | 0.733959 |
dee1fca7f4eb4f62d617b8570c4c71d5577f3d76 | 2,250 | py | Python | lib/exabgp/configuration/flow/then.py | earies/exabgp | dc11110e7e14f6a93dd62b94cd532d03ca730679 | [
"BSD-3-Clause"
] | null | null | null | lib/exabgp/configuration/flow/then.py | earies/exabgp | dc11110e7e14f6a93dd62b94cd532d03ca730679 | [
"BSD-3-Clause"
] | null | null | null | lib/exabgp/configuration/flow/then.py | earies/exabgp | dc11110e7e14f6a93dd62b94cd532d03ca730679 | [
"BSD-3-Clause"
] | null | null | null | # encoding: utf-8
"""
parse_flow.py
Created by Thomas Mangin on 2015-06-22.
Copyright (c) 2009-2015 Exa Networks. All rights reserved.
"""
from exabgp.configuration.core import Section
from exabgp.configuration.flow.parser import accept
from exabgp.configuration.flow.parser import discard
from exabgp.configuration.f... | 26.162791 | 65 | 0.649778 |
965ce595cd4fb89ef3d08bdb4ccc8a99358ed050 | 6,433 | py | Python | 180712_DownloadCities.py | nateraluis/phd_server | 0df6ffd9ce955718b6af908406374c93966b4c6c | [
"MIT"
] | null | null | null | 180712_DownloadCities.py | nateraluis/phd_server | 0df6ffd9ce955718b6af908406374c93966b4c6c | [
"MIT"
] | null | null | null | 180712_DownloadCities.py | nateraluis/phd_server | 0df6ffd9ce955718b6af908406374c93966b4c6c | [
"MIT"
] | null | null | null |
import time
import osmnx as ox
import os
import networkx as nx
#get_ipython().run_line_magic('matplotlib', 'inline')
useful_tags = ox.settings.useful_tags_path + ['cycleway']
ox.config(data_folder='Data', logs_folder='logs',
imgs_folder='imgs', cache_folder='cache',
use_cache=True, log_console=T... | 35.153005 | 104 | 0.6291 |
2c096831e0fc48b81f46ed4ee8c3b853ed0b948d | 1,044 | py | Python | tests/test_pgdump.py | jshahbazi/pgbackup | 6b1dce5290566c2db10b7732ee93e6e63c0861b2 | [
"MIT"
] | null | null | null | tests/test_pgdump.py | jshahbazi/pgbackup | 6b1dce5290566c2db10b7732ee93e6e63c0861b2 | [
"MIT"
] | null | null | null | tests/test_pgdump.py | jshahbazi/pgbackup | 6b1dce5290566c2db10b7732ee93e6e63c0861b2 | [
"MIT"
] | null | null | null | import pytest
import subprocess
from pgbackup import pgdump
url = "postgres://bob:password@example.com:5432/db_one"
def test_dump_calls_pg_dump(mocker):
"""
Utilize pg_dump with the database URL
"""
mocker.patch('subprocess.Popen')
assert pgdump.dump(url)
subprocess.Popen.assert_called_with([... | 29.828571 | 84 | 0.70977 |
42f169de73207c41b84a753839f824ef23b60a4e | 3,602 | py | Python | leetcode_python/Depth-First-Search/strobogrammatic-number-ii.py | yennanliu/Python_basics | 6a597442d39468295946cefbfb11d08f61424dc3 | [
"Unlicense"
] | 18 | 2019-08-01T07:45:02.000Z | 2022-03-31T18:05:44.000Z | leetcode_python/Depth-First-Search/strobogrammatic-number-ii.py | yennanliu/Python_basics | 6a597442d39468295946cefbfb11d08f61424dc3 | [
"Unlicense"
] | null | null | null | leetcode_python/Depth-First-Search/strobogrammatic-number-ii.py | yennanliu/Python_basics | 6a597442d39468295946cefbfb11d08f61424dc3 | [
"Unlicense"
] | 15 | 2019-12-29T08:46:20.000Z | 2022-03-08T14:14:05.000Z | # V0
class Solution:
"""
@param n: the length of strobogrammatic number
@return: All strobogrammatic numbers
"""
def findStrobogrammatic(self, n):
evenMidCandidate = ["11","69","88","96", "00"]
oddMidCandidate = ["0", "1", "8"]
if n == 0:
return [""]
if n... | 30.268908 | 88 | 0.463076 |
a2564476745cd953a7a6c19671e16b940a43c550 | 196 | py | Python | wooey/tests/scripts/versioned_script/v3.py | fridmundklaus/wooey | 4a2e31c282bfe86edf77b0ff8f58f4177eeab9dd | [
"BSD-3-Clause"
] | 1,572 | 2015-06-19T21:31:41.000Z | 2022-03-30T23:37:13.000Z | wooey/tests/scripts/versioned_script/v3.py | fridmundklaus/wooey | 4a2e31c282bfe86edf77b0ff8f58f4177eeab9dd | [
"BSD-3-Clause"
] | 309 | 2015-07-08T02:33:08.000Z | 2022-02-08T00:37:11.000Z | wooey/tests/scripts/versioned_script/v3.py | fridmundklaus/wooey | 4a2e31c282bfe86edf77b0ff8f58f4177eeab9dd | [
"BSD-3-Clause"
] | 220 | 2015-07-01T10:30:27.000Z | 2022-02-05T04:10:54.000Z | import argparse
import os
parser = argparse.ArgumentParser(description="This is version 3")
parser.add_argument('--one')
if __name__ == '__main__':
args = parser.parse_args()
print(args) | 21.777778 | 65 | 0.729592 |
875f0c7e9bfc78732417d7937f6abb2e8862b6ec | 376 | py | Python | tests/test_newsapi.py | plasticruler/newshound | c97ef09165eabb27ac65682e4893cf72dae7f3fb | [
"Apache-2.0"
] | null | null | null | tests/test_newsapi.py | plasticruler/newshound | c97ef09165eabb27ac65682e4893cf72dae7f3fb | [
"Apache-2.0"
] | null | null | null | tests/test_newsapi.py | plasticruler/newshound | c97ef09165eabb27ac65682e4893cf72dae7f3fb | [
"Apache-2.0"
] | null | null | null | import unittest
from sources.newsapi import NewsApi
class TestNewsApi(unittest.TestCase):
def test_get_newsapi(self):
hn = NewsApi("c2d941c74c144421945618d97a458144") #get a seperate key?
articles = hn.get_articles(limit=2)
self.assertNotEqual(0,len(articles),"No articles ... | 31.333333 | 78 | 0.696809 |
7d608acb06b016d1a79b30fca8ee444b64b6b8f4 | 1,255 | py | Python | Django2.0-Python-Full-Stack-Web-Developer/15-Django_Level_Two/first_project/populate_first_app.py | nobodysshadow/udemy_django | ff564d5d03f579be80ba03ae85230a1f19321e31 | [
"MIT"
] | 6 | 2021-07-26T14:21:25.000Z | 2021-07-26T14:32:01.000Z | Django2.0-Python-Full-Stack-Web-Developer/15-Django_Level_Two/first_project/populate_first_app.py | nobodysshadow/udemy_django | ff564d5d03f579be80ba03ae85230a1f19321e31 | [
"MIT"
] | 2 | 2021-12-10T10:25:19.000Z | 2021-12-10T10:27:15.000Z | Web-Dev/DJANGO_COURSE_1.xx/Django_Level_Two/first_project/populate_first_app.py | Advik-B/Learn-Python | 66ac57259764e8f2c3c6513a8de6c106800d8abe | [
"MIT"
] | null | null | null | import os
# Configure settings for project
# Need to run this before calling models from application!
os.environ.setdefault('DJANGO_SETTINGS_MODULE','first_project.settings')
import django
# Import settings
django.setup()
import random
from first_app.models import Topic,Webpage,AccessRecord
from faker import Faker
f... | 24.607843 | 87 | 0.682072 |
023897b4a0122c21b93120eee711eb2d4f3d64b5 | 6,060 | py | Python | netbox/secrets/forms.py | xcorp/netbox | 48b9c9da932dc736710d9c14793067093f8f1bde | [
"Apache-2.0"
] | null | null | null | netbox/secrets/forms.py | xcorp/netbox | 48b9c9da932dc736710d9c14793067093f8f1bde | [
"Apache-2.0"
] | null | null | null | netbox/secrets/forms.py | xcorp/netbox | 48b9c9da932dc736710d9c14793067093f8f1bde | [
"Apache-2.0"
] | null | null | null | from Crypto.Cipher import PKCS1_OAEP
from Crypto.PublicKey import RSA
from django import forms
from taggit.forms import TagField
from dcim.models import Device
from extras.forms import AddRemoveTagsForm, CustomFieldBulkEditForm, CustomFieldFilterForm, CustomFieldForm
from utilities.forms import (
APISelect, APISel... | 26.933333 | 117 | 0.610231 |
87a764208d82c167bc4fd595cf7148219513710a | 635 | py | Python | users/serializers.py | JonnatasCabral/todolist | c0dc602bf1911e72593507e87bd9ae7695f7f7fc | [
"MIT"
] | null | null | null | users/serializers.py | JonnatasCabral/todolist | c0dc602bf1911e72593507e87bd9ae7695f7f7fc | [
"MIT"
] | null | null | null | users/serializers.py | JonnatasCabral/todolist | c0dc602bf1911e72593507e87bd9ae7695f7f7fc | [
"MIT"
] | null | null | null | from django.contrib.auth import authenticate
from rest_framework import serializers
from rest_auth.serializers import LoginSerializer
from users.models import User
class UserSerializer(serializers.ModelSerializer):
def create(self, validated_data):
user = User.objects.create_user(
validated... | 24.423077 | 64 | 0.629921 |
782764fe330588502a9d9d4d72a799d674a8b600 | 5,417 | py | Python | sim/sim-tracing.py | covid19-model/simulator | ab3eb808293e93343804e636764c1607f15f2b08 | [
"MIT"
] | 70 | 2020-04-11T19:19:56.000Z | 2022-03-14T05:24:33.000Z | sim/sim-tracing.py | Kipropa/simulator | ab3eb808293e93343804e636764c1607f15f2b08 | [
"MIT"
] | 8 | 2020-04-22T08:25:04.000Z | 2021-02-24T12:05:17.000Z | sim/sim-tracing.py | Kipropa/simulator | ab3eb808293e93343804e636764c1607f15f2b08 | [
"MIT"
] | 37 | 2020-04-16T16:20:17.000Z | 2021-10-01T17:05:50.000Z |
import sys
if '..' not in sys.path:
sys.path.append('..')
import random as rd
import pandas as pd
from lib.measures import *
from lib.experiment import Experiment, options_to_str, process_command_line
from lib.calibrationFunctions import get_calibrated_params, get_calibrated_params_from_path
from lib.distribution... | 34.724359 | 91 | 0.598302 |
029cfc01d88b71cc6360712e08c7f07721e64450 | 1,049 | py | Python | src/Logikanalysator/sigrok-integration/libsigrokdecode/decoders/midi/__init__.py | dm7h/fpga-event-recorder | 4e53babbbb514ee375f4b5585b1d24e5b40f8df7 | [
"0BSD"
] | null | null | null | src/Logikanalysator/sigrok-integration/libsigrokdecode/decoders/midi/__init__.py | dm7h/fpga-event-recorder | 4e53babbbb514ee375f4b5585b1d24e5b40f8df7 | [
"0BSD"
] | null | null | null | src/Logikanalysator/sigrok-integration/libsigrokdecode/decoders/midi/__init__.py | dm7h/fpga-event-recorder | 4e53babbbb514ee375f4b5585b1d24e5b40f8df7 | [
"0BSD"
] | null | null | null | ##
## This file is part of the libsigrokdecode project.
##
## Copyright (C) 2013 Uwe Hermann <uwe@hermann-uwe.de>
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 2 of the Li... | 33.83871 | 76 | 0.734986 |
64d496a8f16eff8b26e241777df00ffb1fde44c6 | 55,548 | py | Python | test/sql/test_resultset.py | rissikess/sqlalchemy-ceodbc | 6f81f3f7a3c6e39843d478e11e010923a3bf7672 | [
"MIT"
] | null | null | null | test/sql/test_resultset.py | rissikess/sqlalchemy-ceodbc | 6f81f3f7a3c6e39843d478e11e010923a3bf7672 | [
"MIT"
] | null | null | null | test/sql/test_resultset.py | rissikess/sqlalchemy-ceodbc | 6f81f3f7a3c6e39843d478e11e010923a3bf7672 | [
"MIT"
] | null | null | null | from sqlalchemy.testing import eq_, assert_raises_message, assert_raises, \
in_, not_in_, is_, ne_, le_
from sqlalchemy import testing
from sqlalchemy.testing import fixtures, engines
from sqlalchemy import util
from sqlalchemy import (
exc, sql, func, select, String, Integer, MetaData, ForeignKey,
VARCHAR,... | 32.42732 | 79 | 0.544844 |
b3700103fee0d65a639749f910f1454dc55d1ec5 | 2,167 | py | Python | share/qt/extract_strings_qt.py | Nugetzrul3/dogecash | f09a4ed70e9ea6f5599c8a20fe255cbe24373cc1 | [
"MIT"
] | 52 | 2018-10-08T07:17:35.000Z | 2021-11-29T22:53:08.000Z | share/qt/extract_strings_qt.py | Nugetzrul3/dogecash | f09a4ed70e9ea6f5599c8a20fe255cbe24373cc1 | [
"MIT"
] | 50 | 2018-10-20T10:42:54.000Z | 2021-02-15T21:53:51.000Z | share/qt/extract_strings_qt.py | Nugetzrul3/dogecash | f09a4ed70e9ea6f5599c8a20fe255cbe24373cc1 | [
"MIT"
] | 53 | 2018-11-03T16:42:43.000Z | 2021-12-11T03:55:21.000Z | #!/usr/bin/python
'''
Extract _("...") strings for translation and convert to Qt stringdefs so that
they can be picked up by Qt linguist.
'''
from __future__ import division,print_function,unicode_literals
from subprocess import Popen, PIPE
import glob
import operator
import os
import sys
OUT_CPP="qt/dogecashstrings.c... | 25.797619 | 105 | 0.620212 |
23f5c64fb9f0d09ec79ab076bfa18d08debbd7a5 | 2,017 | py | Python | modules/fdns.py | it-jhack/subtaker | a6c0e373c358b6ff849e6bfa835c80f9f7db93de | [
"MIT"
] | null | null | null | modules/fdns.py | it-jhack/subtaker | a6c0e373c358b6ff849e6bfa835c80f9f7db93de | [
"MIT"
] | null | null | null | modules/fdns.py | it-jhack/subtaker | a6c0e373c358b6ff849e6bfa835c80f9f7db93de | [
"MIT"
] | 1 | 2021-02-12T09:21:59.000Z | 2021-02-12T09:21:59.000Z | import subprocess
import modules.utils
from more_itertools import unique_everseen
# Converts subdomain text in order to be parsed by grep and jq commands
# It is important to keep the same domains order in both 'grep_list' and 'jq_regex_list'
def _grep_jq_convert(domain):
'''Transforms a (sub)domain into two str... | 30.104478 | 123 | 0.629648 |
3f7570859b3ca07396011341fa5e5b401d8a747f | 21,534 | py | Python | nuitka/tree/ReformulationContractionExpressions.py | CoyoteLeo/Nuitka | f9db11d82af13af46f3c09bced5f6ea26cf29572 | [
"Apache-2.0"
] | null | null | null | nuitka/tree/ReformulationContractionExpressions.py | CoyoteLeo/Nuitka | f9db11d82af13af46f3c09bced5f6ea26cf29572 | [
"Apache-2.0"
] | 1 | 2020-07-11T17:53:56.000Z | 2020-07-11T17:53:56.000Z | nuitka/tree/ReformulationContractionExpressions.py | CoyoteLeo/Nuitka | f9db11d82af13af46f3c09bced5f6ea26cf29572 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020, Kay Hayen, mailto:kay.hayen@gmail.com
#
# Part of "Nuitka", an optimizing Python compiler that is compatible and
# integrates with CPython, but also works on its own.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in complianc... | 32.627273 | 88 | 0.63885 |
4792491c32adcc1c92a437caa63500fdb9154dc9 | 1,878 | py | Python | example/runner.py | SJTU-IPADS/fgnn-artifacts | c96e7ec8204d767152958dc63a764466e90424fd | [
"Apache-2.0"
] | 23 | 2022-01-25T13:28:51.000Z | 2022-03-23T07:05:47.000Z | example/runner.py | SJTU-IPADS/gnnlab | 5c73564e4a9bd5deeff7eed0b923c115ccba34d7 | [
"Apache-2.0"
] | null | null | null | example/runner.py | SJTU-IPADS/gnnlab | 5c73564e4a9bd5deeff7eed0b923c115ccba34d7 | [
"Apache-2.0"
] | 1 | 2022-02-28T18:48:56.000Z | 2022-02-28T18:48:56.000Z | from runner_helper import Arch, RunConfig, ConfigList, App, Dataset, CachePolicy, TMP_LOG_DIR, run_in_list, SampleType, percent_gen
import os
def tmp_call_back(cfg: RunConfig):
os.system(f"grep -A 4 'average' \"{cfg.get_log_fname()}.log\"")
if __name__ == '__main__':
from sys import argv
do_mock = False
durab... | 27.617647 | 131 | 0.621406 |
188e6815d2f1fda3e09911ed47927b798bab3c6c | 9,449 | py | Python | reproject/mosaicking/tests/test_coadd.py | bryanmiller/reproject | e0472eb79c9f343a8371b655a1c4d23c8bb864b3 | [
"BSD-3-Clause"
] | 2 | 2020-12-11T14:44:13.000Z | 2020-12-11T14:44:15.000Z | reproject/mosaicking/tests/test_coadd.py | mwest007/reproject | e0472eb79c9f343a8371b655a1c4d23c8bb864b3 | [
"BSD-3-Clause"
] | null | null | null | reproject/mosaicking/tests/test_coadd.py | mwest007/reproject | e0472eb79c9f343a8371b655a1c4d23c8bb864b3 | [
"BSD-3-Clause"
] | null | null | null | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import os
import random
import numpy as np
import pytest
from astropy.wcs import WCS
from astropy.io.fits import Header
from numpy.testing import assert_allclose
from ... import reproject_exact, reproject_interp
from ..coadd import reproject_and_coadd
... | 36.342308 | 89 | 0.572971 |
131b02e0190bd9e67e784eea7c61f989b1bfa882 | 9,493 | py | Python | MedicalDecisionDiabetes/MedicalDecisionDiabetesModel.py | nikunjpansari/stochastic-optimization | a01e95e9168dd8f87751c29f94bb382f83567e71 | [
"MIT"
] | 92 | 2019-05-08T15:12:03.000Z | 2022-03-31T08:47:57.000Z | MedicalDecisionDiabetes/MedicalDecisionDiabetesModel.py | nikunjpansari/stochastic-optimization | a01e95e9168dd8f87751c29f94bb382f83567e71 | [
"MIT"
] | 1 | 2020-12-15T22:24:45.000Z | 2020-12-15T22:24:45.000Z | MedicalDecisionDiabetes/MedicalDecisionDiabetesModel.py | nikunjpansari/stochastic-optimization | a01e95e9168dd8f87751c29f94bb382f83567e71 | [
"MIT"
] | 50 | 2019-03-04T21:12:18.000Z | 2022-03-23T05:06:09.000Z | """
Model class - Medical Decisions Diabetes Treatments
"""
from collections import namedtuple
import numpy as np
import pandas as pd
import math
from random import randint
# This function returns the precision (beta), given the s.d. (sigma)
def Beta(sigma):
return 1/sigma**2
class MedicalDecisionDiabetesModel()... | 46.534314 | 213 | 0.620773 |
3b81e9e2f5c3f95f7f1c3d985154f990d46a4a6b | 607 | py | Python | app/controller/Ping.py | junpengxu/MyFlask | 14457b5c44e9a2a881cf2b5c1ed9ba7bf783b31a | [
"MIT"
] | null | null | null | app/controller/Ping.py | junpengxu/MyFlask | 14457b5c44e9a2a881cf2b5c1ed9ba7bf783b31a | [
"MIT"
] | null | null | null | app/controller/Ping.py | junpengxu/MyFlask | 14457b5c44e9a2a881cf2b5c1ed9ba7bf783b31a | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# @Time : 2021/10/24 3:33 下午
# @Author : xujunpeng
import time
from typing import List, Dict
from app.base.base_controller import BaseController
from app.model.ping import Ping
class PingController(BaseController):
def get(self, pk):
Ping.query.get(pk).simple_info()
P... | 26.391304 | 83 | 0.637562 |
146de10cf52cd08b96f1557effb5cf82f8708501 | 6,575 | py | Python | run_predictions/run_Rosetta/fixbb.py | wells-wood-research/PDBench | 8d8ce16a5554ac15ed8593b7846da93498fc9bfe | [
"MIT"
] | 1 | 2021-08-01T21:23:21.000Z | 2021-08-01T21:23:21.000Z | run_predictions/run_Rosetta/fixbb.py | wells-wood-research/PDBench | 8d8ce16a5554ac15ed8593b7846da93498fc9bfe | [
"MIT"
] | 10 | 2021-05-05T12:01:53.000Z | 2021-09-01T16:45:18.000Z | run_predictions/run_Rosetta/fixbb.py | wells-wood-research/PDBench | 8d8ce16a5554ac15ed8593b7846da93498fc9bfe | [
"MIT"
] | 1 | 2021-08-14T14:26:16.000Z | 2021-08-14T14:26:16.000Z | import ampal
import gzip
import glob
import subprocess
import multiprocessing
import os
from pathlib import Path
from sklearn.preprocessing import OneHotEncoder
import warnings
import numpy as np
import pandas as pd
import string
import urllib
from sklearn import metrics
import numpy as np
acids = [
"A",
"C",
... | 30.16055 | 211 | 0.572167 |
d493243ba40b13e8763016daae5929b87739c50c | 126 | py | Python | languages/python/design_stackinspection.py | Andilyn/learntosolveit | fd15345c74ef543e4e26f4691bf91cb6dac568a4 | [
"BSD-3-Clause"
] | 1 | 2021-04-09T04:15:24.000Z | 2021-04-09T04:15:24.000Z | languages/python/design_stackinspection.py | Andilyn/learntosolveit | fd15345c74ef543e4e26f4691bf91cb6dac568a4 | [
"BSD-3-Clause"
] | null | null | null | languages/python/design_stackinspection.py | Andilyn/learntosolveit | fd15345c74ef543e4e26f4691bf91cb6dac568a4 | [
"BSD-3-Clause"
] | 1 | 2021-07-31T02:45:29.000Z | 2021-07-31T02:45:29.000Z | import sys
def foo():
"""blah"""
print sys._getframe().f_back.f_locals[sys._getframe().f_code.co_name].__doc__
foo()
| 18 | 81 | 0.674603 |
5d5b9faca2b83d46cd7225ec077da749797d7e7e | 1,022 | py | Python | inference/src/models.py | fojor/object-cut | 2e9102ef7d21e056110a94931a91a75ae6a2114a | [
"Apache-2.0"
] | 87 | 2019-09-06T08:24:11.000Z | 2022-03-27T10:54:48.000Z | inference/src/models.py | fojor/object-cut | 2e9102ef7d21e056110a94931a91a75ae6a2114a | [
"Apache-2.0"
] | 3 | 2021-03-06T13:23:16.000Z | 2021-04-26T03:03:17.000Z | inference/src/models.py | fojor/object-cut | 2e9102ef7d21e056110a94931a91a75ae6a2114a | [
"Apache-2.0"
] | 12 | 2019-09-24T17:21:46.000Z | 2022-02-24T16:18:11.000Z | from pydantic import BaseModel
from src import EXAMPLE_IMAGE_PATH, EXAMPLE_MESSAGE_SUCCESS
class EngineRequest(BaseModel):
"""
This schema contains how a request should be.
It contains a string that contains an image path and a boolean that tells us if we want white or transparent bg.
"""
img: s... | 26.894737 | 116 | 0.694716 |
d924f2d8f8d3e94b462fde52e64c6e8b5ee3428c | 505 | py | Python | rest/call/list-get-example-3/list-get-example-3.6.x.py | azaddeveloper/api-snippets | f88b153cd7186fa70b33733b205886502db0d1f2 | [
"MIT"
] | 3 | 2020-05-05T10:01:02.000Z | 2021-02-06T14:23:13.000Z | rest/call/list-get-example-3/list-get-example-3.6.x.py | azaddeveloper/api-snippets | f88b153cd7186fa70b33733b205886502db0d1f2 | [
"MIT"
] | null | null | null | rest/call/list-get-example-3/list-get-example-3.6.x.py | azaddeveloper/api-snippets | f88b153cd7186fa70b33733b205886502db0d1f2 | [
"MIT"
] | 1 | 2019-10-02T14:36:36.000Z | 2019-10-02T14:36:36.000Z | # Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import Client
from datetime import date
# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token = "your_auth_token"
client = Client(account_sid, auth_token)
# ... | 29.705882 | 72 | 0.784158 |
72913ddaec4eb1f655ddef1c6afde6256b8ecffc | 9,276 | py | Python | python/mxnet/contrib/onnx/onnx2mx/import_onnx.py | mchoi8739/incubator-mxnet | cff583250479b31c394f568ffb835b720cb84dc4 | [
"Apache-2.0"
] | 211 | 2016-06-06T08:32:36.000Z | 2021-07-03T16:50:16.000Z | python/mxnet/contrib/onnx/onnx2mx/import_onnx.py | mchoi8739/incubator-mxnet | cff583250479b31c394f568ffb835b720cb84dc4 | [
"Apache-2.0"
] | 82 | 2016-03-29T02:40:02.000Z | 2021-02-06T22:20:40.000Z | python/mxnet/contrib/onnx/onnx2mx/import_onnx.py | mchoi8739/incubator-mxnet | cff583250479b31c394f568ffb835b720cb84dc4 | [
"Apache-2.0"
] | 58 | 2016-10-27T07:37:08.000Z | 2021-07-03T16:50:17.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 40.50655 | 94 | 0.594114 |
2371bc3517fc9219bafd6362b02281161d549e10 | 2,957 | py | Python | clubs/views.py | aprefontaine/TMScheduler | 298a332532b9df1d3f6a80b1334630bc106d3b78 | [
"BSD-3-Clause"
] | 1 | 2015-08-30T16:48:17.000Z | 2015-08-30T16:48:17.000Z | clubs/views.py | aprefontaine/TMScheduler | 298a332532b9df1d3f6a80b1334630bc106d3b78 | [
"BSD-3-Clause"
] | null | null | null | clubs/views.py | aprefontaine/TMScheduler | 298a332532b9df1d3f6a80b1334630bc106d3b78 | [
"BSD-3-Clause"
] | null | null | null | from django.shortcuts import get_object_or_404, render_to_response
from django.http import HttpResponseRedirect, HttpResponse
from django.core.urlresolvers import reverse
from django.template import RequestContext
from clubs.models import Club
import datetime
class ClubContextBase:
Type = 0
ClubList = []
... | 37.43038 | 121 | 0.670274 |
4a72082d0576df7e5e9b2ac28436950734e24d3d | 253 | py | Python | reporter/__init__.py | josevnz/rpm_query | c84b40232a8284a02b475baadf7ed2eb0d789899 | [
"Apache-2.0"
] | null | null | null | reporter/__init__.py | josevnz/rpm_query | c84b40232a8284a02b475baadf7ed2eb0d789899 | [
"Apache-2.0"
] | null | null | null | reporter/__init__.py | josevnz/rpm_query | c84b40232a8284a02b475baadf7ed2eb0d789899 | [
"Apache-2.0"
] | 1 | 2021-12-03T05:30:36.000Z | 2021-12-03T05:30:36.000Z | __version__ = "0.0.1"
def __is_valid_limit__(limit: str) -> int:
try:
int_limit = int(limit)
if int_limit <= 0:
raise ValueError(f"Invalid limit!: {limit}")
return int_limit
except ValueError:
raise
| 21.083333 | 56 | 0.581028 |
bd6f062feb56351b8bab3b1aa1a99eaef71af2a3 | 135 | py | Python | fl_blog/main/views.py | anshgandhi/flask_blogging | 518305d602e9834744b89f96e1e230b6b24f9ca1 | [
"MIT"
] | null | null | null | fl_blog/main/views.py | anshgandhi/flask_blogging | 518305d602e9834744b89f96e1e230b6b24f9ca1 | [
"MIT"
] | null | null | null | fl_blog/main/views.py | anshgandhi/flask_blogging | 518305d602e9834744b89f96e1e230b6b24f9ca1 | [
"MIT"
] | null | null | null | from flask import render_template
from fl_blog.main import main
@main.route('/')
def index():
return render_template('index.html') | 22.5 | 40 | 0.755556 |
076f782ac349984b22e0c33d0750faea62364f06 | 1,226 | py | Python | demo_shop/demo_shop/urls.py | Bincha3000/Django-shop | e2ea4df50ea3c542f1a0b9b6881be5c9cd8261d8 | [
"MIT"
] | null | null | null | demo_shop/demo_shop/urls.py | Bincha3000/Django-shop | e2ea4df50ea3c542f1a0b9b6881be5c9cd8261d8 | [
"MIT"
] | 10 | 2020-02-12T00:49:15.000Z | 2022-02-10T09:20:02.000Z | demo_shop/demo_shop/urls.py | gladunvv/django-shop | e2ea4df50ea3c542f1a0b9b6881be5c9cd8261d8 | [
"MIT"
] | null | null | null | """demo_shop URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.2/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... | 37.151515 | 80 | 0.704731 |
230a8a9d263188fc28471220e948c925746caf1f | 1,807 | py | Python | src/inmanta/execute/tracking.py | inmanta/inmanta-core | ae2153d57f124d00ad1b58e6d4bc6818364be4a8 | [
"Apache-2.0"
] | 6 | 2021-03-09T10:24:02.000Z | 2022-01-16T03:52:11.000Z | src/inmanta/execute/tracking.py | inmanta/inmanta-core | ae2153d57f124d00ad1b58e6d4bc6818364be4a8 | [
"Apache-2.0"
] | 1,319 | 2020-12-18T08:52:29.000Z | 2022-03-31T18:17:32.000Z | src/inmanta/execute/tracking.py | inmanta/inmanta-core | ae2153d57f124d00ad1b58e6d4bc6818364be4a8 | [
"Apache-2.0"
] | 4 | 2021-03-03T15:36:50.000Z | 2022-03-11T11:41:51.000Z | """
Copyright 2017 Inmanta
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 ... | 31.155172 | 121 | 0.727726 |
5ee1c929b84bacd5912c86bf87e6d330fdbd1728 | 3,907 | py | Python | setup.py | mothsART/linkmanager | 5213eb2757e76caaf919bc1f5158af7830fb4165 | [
"BSD-2-Clause"
] | null | null | null | setup.py | mothsART/linkmanager | 5213eb2757e76caaf919bc1f5158af7830fb4165 | [
"BSD-2-Clause"
] | null | null | null | setup.py | mothsART/linkmanager | 5213eb2757e76caaf919bc1f5158af7830fb4165 | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
import os
import sys
try:
# python 3
from urllib import request
except:
# python 2
import urllib as request
from setuptools import setup, find_packages
from setuptools.command import easy_install
from setuptools.command.test import test as TestCommand
from linkmanager import (... | 27.70922 | 69 | 0.620425 |
8258bb63c4178ba9abc1b609e83f9aeb2da19a17 | 3,877 | py | Python | summary/sumy/sklearn/datasets/california_housing.py | WangWenjun559/MITS | 8d7ace2b3b2a58fb33af225c2997106d9402aaf5 | [
"Apache-2.0"
] | 6 | 2015-07-12T16:17:58.000Z | 2017-06-23T04:00:43.000Z | summary/sumy/sklearn/datasets/california_housing.py | WangWenjun559/MITS | 8d7ace2b3b2a58fb33af225c2997106d9402aaf5 | [
"Apache-2.0"
] | null | null | null | summary/sumy/sklearn/datasets/california_housing.py | WangWenjun559/MITS | 8d7ace2b3b2a58fb33af225c2997106d9402aaf5 | [
"Apache-2.0"
] | 4 | 2017-04-19T09:05:26.000Z | 2020-05-20T21:54:25.000Z | """California housing dataset.
The original database is available from StatLib
http://lib.stat.cmu.edu/
The data contains 20,640 observations on 9 variables.
This dataset contains the average house value as target variable
and the following input variables (features): average income,
housing average age, averag... | 30.527559 | 79 | 0.668816 |
f006a4263012ea59a55e922d641a1225d855011d | 199 | py | Python | pages/admin.py | BirdOnTheBranch/web-pictures | 1dbe655df4ab4546f1f8a6863de55b09bf9886a8 | [
"MIT"
] | 1 | 2020-05-08T08:42:20.000Z | 2020-05-08T08:42:20.000Z | pages/admin.py | BirdOnTheBranch/web-pictures | 1dbe655df4ab4546f1f8a6863de55b09bf9886a8 | [
"MIT"
] | null | null | null | pages/admin.py | BirdOnTheBranch/web-pictures | 1dbe655df4ab4546f1f8a6863de55b09bf9886a8 | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import Page
class PagesAdmin(admin.ModelAdmin):
readonly_fields = ('created', 'updated', 'slug', 'likes')
admin.site.register(Page, PagesAdmin)
| 18.090909 | 61 | 0.738693 |
124f837e9fba48ce2ba03d6fba322f721d74f2c5 | 7,088 | py | Python | tensorflow/tools/compatibility/tf_upgrade_v2_main.py | scentini/tensorflow | 204ed332c0886a0e0ab10b22ba8d67b97e1c83c4 | [
"Apache-2.0"
] | 56 | 2018-06-21T13:47:23.000Z | 2020-05-13T09:31:47.000Z | tensorflow/tools/compatibility/tf_upgrade_v2_main.py | scentini/tensorflow | 204ed332c0886a0e0ab10b22ba8d67b97e1c83c4 | [
"Apache-2.0"
] | 5 | 2020-06-01T18:50:38.000Z | 2021-07-16T07:13:52.000Z | tensorflow/tools/compatibility/tf_upgrade_v2_main.py | scentini/tensorflow | 204ed332c0886a0e0ab10b22ba8d67b97e1c83c4 | [
"Apache-2.0"
] | 15 | 2018-09-06T14:18:32.000Z | 2020-05-14T06:35:30.000Z | # Lint as: python2, python3
# Copyright 2018 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
#
... | 35.79798 | 80 | 0.665068 |
1f694e3091d7a2bcfe7fb01f9d91b9c9d35d4067 | 949 | py | Python | neutrino-winds/tests/test_Adiabatic_wind_solver.py | colbrydi/neutrino-winds | 0088a0568841cda00ee8303b797d05be9feab844 | [
"BSD-3-Clause"
] | null | null | null | neutrino-winds/tests/test_Adiabatic_wind_solver.py | colbrydi/neutrino-winds | 0088a0568841cda00ee8303b797d05be9feab844 | [
"BSD-3-Clause"
] | null | null | null | neutrino-winds/tests/test_Adiabatic_wind_solver.py | colbrydi/neutrino-winds | 0088a0568841cda00ee8303b797d05be9feab844 | [
"BSD-3-Clause"
] | null | null | null | import os, sys
sys.path.append("")
import Adiabatic_wind_solver as aws
import pytest
import numpy as np
def test_pc():
'''Simple test of the percent change function'''
s=aws.solver()
assert s.percentChange(np.array([10,0]),np.array([11,0]))==10.0
def test_dw():
'''Checks that the isothermal (base... | 31.633333 | 90 | 0.679663 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.