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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
a81b2379c348bbf473cf4eb8724fdc28b37848dd | 123 | py | Python | tests/context.py | astercrono/python-datareport | 4162ecebea27645559161f46b24fd46917827bbd | [
"BSD-3-Clause"
] | null | null | null | tests/context.py | astercrono/python-datareport | 4162ecebea27645559161f46b24fd46917827bbd | [
"BSD-3-Clause"
] | null | null | null | tests/context.py | astercrono/python-datareport | 4162ecebea27645559161f46b24fd46917827bbd | [
"BSD-3-Clause"
] | 1 | 2019-02-05T20:40:29.000Z | 2019-02-05T20:40:29.000Z | import os
import sys
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
import datareport
| 20.5 | 82 | 0.739837 |
0e207b8147b3af628969cdd197abf18cbd7316e9 | 3,675 | py | Python | scripts3/crypto.py | AlexOConnorHub/GitCTF | 406fd761961019c74b9f9b714eef0b2044a1e5fc | [
"Apache-2.0"
] | null | null | null | scripts3/crypto.py | AlexOConnorHub/GitCTF | 406fd761961019c74b9f9b714eef0b2044a1e5fc | [
"Apache-2.0"
] | null | null | null | scripts3/crypto.py | AlexOConnorHub/GitCTF | 406fd761961019c74b9f9b714eef0b2044a1e5fc | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
###############################################################################
# Git-based CTF
###############################################################################
#
# Author: SeongIl Wi <seongil.wi@kaist.ac.kr>
# Jaeseung Choi <jschoi17@kaist.ac.kr>
# Sang Kil Cha <san... | 34.027778 | 105 | 0.651973 |
37b28651b2b161393e5a235b04bbe2bf84d8cacb | 1,560 | py | Python | discord/types/sticker.py | alexyy802/GlowCord | af92f1a11843157aa5484c1781417456175a8ab3 | [
"MIT"
] | null | null | null | discord/types/sticker.py | alexyy802/GlowCord | af92f1a11843157aa5484c1781417456175a8ab3 | [
"MIT"
] | null | null | null | discord/types/sticker.py | alexyy802/GlowCord | af92f1a11843157aa5484c1781417456175a8ab3 | [
"MIT"
] | null | null | null | """
The MIT License (MIT)
Copyright (c) 2015-present Rapptz
Copyright (c) 2021-present tag-epic
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... | 50.322581 | 309 | 0.804487 |
eef38bb24d449850a71010179e9a82eeea12c951 | 929 | py | Python | mark_cities.py | omarTronto/best-flight-algo | 4db60f6a95add6765c0c8eb6e44c2fb9fe6c598b | [
"Apache-2.0"
] | 1 | 2019-07-11T07:38:19.000Z | 2019-07-11T07:38:19.000Z | mark_cities.py | omarTronto/best-flight-algo | 4db60f6a95add6765c0c8eb6e44c2fb9fe6c598b | [
"Apache-2.0"
] | null | null | null | mark_cities.py | omarTronto/best-flight-algo | 4db60f6a95add6765c0c8eb6e44c2fb9fe6c598b | [
"Apache-2.0"
] | 1 | 2019-11-06T22:09:23.000Z | 2019-11-06T22:09:23.000Z | import gmplot
import geocoder
def plot_map_with_marked_cities (cities_list, output_path, center_lat =0, center_long=0, zoom=2):
cities_lats_dict = {}
cities_longs_dict = {}
for each_city in cities_list:
g = geocoder.google(each_city, key="AIzaSyDwDkLHO-xUfosP6CeNGmJwQhPiTK6qyiU")
latlng = g.latlng
cit... | 35.730769 | 115 | 0.749193 |
abd147431caba36879ff06af0775fac1e687b313 | 541 | py | Python | peptide_generation/immunopeptide/util_misc.py | yjzhang2013/pancanatlas_code_public | cd095a7ac1f9e8124a6849be5aa9a4ccf932c31b | [
"MIT"
] | 32 | 2018-08-04T12:34:47.000Z | 2022-03-21T16:16:49.000Z | peptide_generation/immunopeptide/util_misc.py | yjzhang2013/pancanatlas_code_public | cd095a7ac1f9e8124a6849be5aa9a4ccf932c31b | [
"MIT"
] | 6 | 2019-02-19T19:24:24.000Z | 2022-03-01T06:47:11.000Z | peptide_generation/immunopeptide/util_misc.py | ratschlab/pancanatlas_code_public | c50e29440ab4c0d772b3585d43e4668190ec4ae9 | [
"MIT"
] | 16 | 2018-08-22T11:06:23.000Z | 2021-11-01T05:05:30.000Z | ''' Misc. utility functions'''
# Returns header labels corresponding to donor_id and mutation_mode
def header_labels(donor_id, mutation_mode):
if mutation_mode is None:
mutation_type = "REFERENCE"
elif mutation_mode == "both":
mutation_type = "GERM_SOMATIC"
elif mutation_mode == "somatic_on... | 33.8125 | 67 | 0.696858 |
afe31e595bcf6c48ec71a834d4a9a506fd6eb2ec | 323 | py | Python | AlexaSongBot/__init__.py | zooloozoo/AlexaSongBot | 2588ff38cb49cb1feaf0f0a1e06d280999bd46cb | [
"MIT"
] | null | null | null | AlexaSongBot/__init__.py | zooloozoo/AlexaSongBot | 2588ff38cb49cb1feaf0f0a1e06d280999bd46cb | [
"MIT"
] | null | null | null | AlexaSongBot/__init__.py | zooloozoo/AlexaSongBot | 2588ff38cb49cb1feaf0f0a1e06d280999bd46cb | [
"MIT"
] | null | null | null | import logging
from pyrogram import Client
from config import API_HASH, API_ID, BOT_TOKEN
logging.basicConfig(
format="%(asctime)s - %(name)s - %(levelname)s - %(message)s", level=logging.INFO
)
LOGGER = logging.getLogger(__name__)
app = Client("AlexaSongBot", bot_token=BOT_TOKEN, api_hash=API_HASH, api_id=API_I... | 26.916667 | 85 | 0.755418 |
d881693b1b2f4a37334d9704e52274f5b5f76dc6 | 4,015 | py | Python | bib2xml.py | Devsart/bib2xml | 4e42aee42dc4cfe03b8d5b07e1291d148b288c41 | [
"MIT"
] | 2 | 2021-12-22T14:07:27.000Z | 2022-01-17T17:03:33.000Z | bib2xml.py | Devsart/bib2xml | 4e42aee42dc4cfe03b8d5b07e1291d148b288c41 | [
"MIT"
] | null | null | null | bib2xml.py | Devsart/bib2xml | 4e42aee42dc4cfe03b8d5b07e1291d148b288c41 | [
"MIT"
] | null | null | null | #!/usr/bin/python
from optparse import OptionParser
from pybtex.database.input import bibtex # https://github.com/chbrown/pybtex
import sys
import xml.etree.cElementTree as ET
import pybtext_conversion_helper
import codecs
parser = OptionParser()
parser.add_option('-a', '--append', dest='inxml', action='store',
... | 38.605769 | 114 | 0.617933 |
539c36cc02e3951cfac09722ca23f15f4d761ce6 | 2,051 | py | Python | {{cookiecutter.project_name}}/docs/conf.py | kelockhart/acutter | 3f7fc9bece1554d1637e147608a4d7eb567aa036 | [
"MIT"
] | null | null | null | {{cookiecutter.project_name}}/docs/conf.py | kelockhart/acutter | 3f7fc9bece1554d1637e147608a4d7eb567aa036 | [
"MIT"
] | null | null | null | {{cookiecutter.project_name}}/docs/conf.py | kelockhart/acutter | 3f7fc9bece1554d1637e147608a4d7eb567aa036 | [
"MIT"
] | 2 | 2022-02-09T15:09:52.000Z | 2022-03-16T20:03:05.000Z | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# if I ever want to make it nicer: https://github.com/construct/construct/tree/master/do... | 35.362069 | 90 | 0.664554 |
1f57d938a12d9c1ca631ee1d25286d09af4a38fe | 394 | py | Python | Dataset/Leetcode/train/20/572.py | kkcookies99/UAST | fff81885aa07901786141a71e5600a08d7cb4868 | [
"MIT"
] | null | null | null | Dataset/Leetcode/train/20/572.py | kkcookies99/UAST | fff81885aa07901786141a71e5600a08d7cb4868 | [
"MIT"
] | null | null | null | Dataset/Leetcode/train/20/572.py | kkcookies99/UAST | fff81885aa07901786141a71e5600a08d7cb4868 | [
"MIT"
] | null | null | null | class Solution:
def XXX(self, s: str) -> bool:
d ={"{":"}","(":")","[":"]"}
t = []
for i in s:
if i in d:
t.append(i)
else:
if len(t)!=0 and d[t[-1]] == i:
t.pop()
else:
return Fa... | 23.176471 | 47 | 0.30203 |
d00f2bac4f575af360e100733c81d34caa20dc8b | 5,239 | py | Python | mne/commands/mne_coreg.py | blakecaldwell/mne-python | 9b5ae5104ecdeaea13a88273c712382bf131162c | [
"BSD-3-Clause"
] | 1 | 2020-07-28T16:09:54.000Z | 2020-07-28T16:09:54.000Z | mne/commands/mne_coreg.py | gkmaro634/mne-python | 5409a89233b764f3f3f3136cf9bf6b8d5fb0a4fe | [
"BSD-3-Clause"
] | 1 | 2019-08-16T13:59:53.000Z | 2019-08-19T16:37:35.000Z | mne/commands/mne_coreg.py | gkmaro634/mne-python | 5409a89233b764f3f3f3136cf9bf6b8d5fb0a4fe | [
"BSD-3-Clause"
] | 1 | 2019-12-10T02:59:18.000Z | 2019-12-10T02:59:18.000Z | #!/usr/bin/env python
# Authors: Christian Brodbeck <christianbrodbeck@nyu.edu>
"""Open the coregistration GUI.
Examples
--------
.. code-block:: console
$ mne coreg
"""
import os.path as op
import sys
import mne
from mne.utils import ETSContext
def run():
"""Run command."""
from mne.commands.utils... | 40.929688 | 79 | 0.578927 |
1792e2d0830dc734d5adbbbac757591146e3f6b2 | 470 | py | Python | infrastructure/user/password.py | atlednolispe/crawler_tools | 6cf9e03986ea72b67b54facb70f3c2c80b9b1f0b | [
"MIT"
] | null | null | null | infrastructure/user/password.py | atlednolispe/crawler_tools | 6cf9e03986ea72b67b54facb70f3c2c80b9b1f0b | [
"MIT"
] | null | null | null | infrastructure/user/password.py | atlednolispe/crawler_tools | 6cf9e03986ea72b67b54facb70f3c2c80b9b1f0b | [
"MIT"
] | null | null | null | import random
def generate_password():
lowers = [chr(i) for i in range(97, 123)]
uppers = [chr(i) for i in range(65, 91)]
numbers = [chr(i) for i in range(48, 58)]
symbols = [i for i in '!#$%^*()']
parts = [lowers, uppers, symbols, numbers]
pw = [''.join(random.choices(part, k=2)) for part in... | 26.111111 | 64 | 0.580851 |
ac930a7a471da4c0770e7df1af4b68406406b8d7 | 2,402 | py | Python | iglu_client/core.py | jhosteny/iglu-python-client | b00548f55eb99c146241be4f724f3da988cd243d | [
"Apache-2.0"
] | null | null | null | iglu_client/core.py | jhosteny/iglu-python-client | b00548f55eb99c146241be4f724f3da988cd243d | [
"Apache-2.0"
] | null | null | null | iglu_client/core.py | jhosteny/iglu-python-client | b00548f55eb99c146241be4f724f3da988cd243d | [
"Apache-2.0"
] | null | null | null | import re
import jsonschema
# Regular expression to extract metadata from self-describing JSON
URI_REGEX = "^iglu:([a-zA-Z0-9\\-_.]+)/([a-zA-Z0-9\\-_]+)/([a-zA-Z0-9\\-_]+)/([1-9][0-9]*(?:-(?:0|[1-9][0-9]*)){2})$"
# Regular expression to extract all parts of SchemaVer: MODEL, REVISION,
# ADDITION
SCHEMAVER_REGEX = "^... | 32.026667 | 117 | 0.606578 |
954f2a7b44de714ed6e74b56fe96480e12b3cb89 | 15,911 | py | Python | example/finetune_ner.py | kunde122/ERNIE1 | 050327e968b2d7d9090ab882a5dd6b0fdeca80b4 | [
"Apache-2.0"
] | 1 | 2020-10-19T09:41:11.000Z | 2020-10-19T09:41:11.000Z | example/finetune_ner.py | kunde122/ERNIE1 | 050327e968b2d7d9090ab882a5dd6b0fdeca80b4 | [
"Apache-2.0"
] | null | null | null | example/finetune_ner.py | kunde122/ERNIE1 | 050327e968b2d7d9090ab882a5dd6b0fdeca80b4 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | 39.977387 | 180 | 0.56904 |
4df8d4bf0cf19b3f54429dcc4a22aeaef4124811 | 5,146 | py | Python | ppml/kms-client/KMS_Client.py | Laniakea94/BigDL | 4d01734086dda893a7f08ba53251dc3c5c8ecfd1 | [
"Apache-2.0"
] | null | null | null | ppml/kms-client/KMS_Client.py | Laniakea94/BigDL | 4d01734086dda893a7f08ba53251dc3c5c8ecfd1 | [
"Apache-2.0"
] | null | null | null | ppml/kms-client/KMS_Client.py | Laniakea94/BigDL | 4d01734086dda893a7f08ba53251dc3c5c8ecfd1 | [
"Apache-2.0"
] | null | null | null | import argparse
import FileOperator, KeyManager
def generate_primary_key(ip, port):
KeyManager.generate_primary_key_ciphertext(ip, port)
def generate_data_key(ip, port, encrypted_primary_key_path):
KeyManager.generate_data_key_ciphertext(ip, port, encrypted_primary_key_path)
def encrypt_file_wit... | 51.979798 | 163 | 0.74796 |
6c90b9f80fb4ad61a7c414f65cd177fdc1d527da | 852 | py | Python | qiskit/grover_algo.py | Lucaman99/Quantum-Computing | 6b63911297829d7f4d5286bcf6fe93b2bf2fb231 | [
"MIT"
] | 5 | 2019-11-12T19:40:23.000Z | 2021-06-21T07:17:29.000Z | qiskit/grover_algo.py | Lucaman99/Quantum-Computing | 6b63911297829d7f4d5286bcf6fe93b2bf2fb231 | [
"MIT"
] | null | null | null | qiskit/grover_algo.py | Lucaman99/Quantum-Computing | 6b63911297829d7f4d5286bcf6fe93b2bf2fb231 | [
"MIT"
] | 3 | 2021-04-11T06:22:39.000Z | 2022-01-02T12:39:02.000Z | from qiskit import QuantumCircuit, ClassicalRegister, QuantumRegister, execute, Aer
#Grover's Algo to find 2 from 4 possible states
n = 4
q = QuantumRegister(n)
c = ClassicalRegister(n)
circuit = QuantumCircuit(q, c)
#Initialize gates
circuit.x(q[2])
circuit.h(q[0])
circuit.h(q[1])
circuit.h(q[2])
#Apply the oracle
... | 20.285714 | 83 | 0.711268 |
a1f078db138b6653ab2db8c13d6629278dec1ecf | 37,976 | py | Python | models/networks.py | zhuxiaofan117/EECS598-Deep-Learning-Final-Project | f0fd47f581d68cf0e7992f3054b81011271b3822 | [
"BSD-3-Clause"
] | null | null | null | models/networks.py | zhuxiaofan117/EECS598-Deep-Learning-Final-Project | f0fd47f581d68cf0e7992f3054b81011271b3822 | [
"BSD-3-Clause"
] | null | null | null | models/networks.py | zhuxiaofan117/EECS598-Deep-Learning-Final-Project | f0fd47f581d68cf0e7992f3054b81011271b3822 | [
"BSD-3-Clause"
] | null | null | null | import torch
import torch.nn as nn
from torch.nn import init
import functools
from torch.optim import lr_scheduler
###############################################################################
# Helper Functions
###############################################################################
def get_norm_layer(norm_... | 45.371565 | 167 | 0.620286 |
6483bb6c073f05396f7375026dd8559266381bd8 | 13,995 | py | Python | content/tests/test_views.py | uktrade/great-domestic-ui | e4c1e4783d7321e170ecb6fd5f9eb6c30cd21f4c | [
"MIT"
] | null | null | null | content/tests/test_views.py | uktrade/great-domestic-ui | e4c1e4783d7321e170ecb6fd5f9eb6c30cd21f4c | [
"MIT"
] | 369 | 2019-02-18T15:53:55.000Z | 2021-06-09T13:17:37.000Z | content/tests/test_views.py | uktrade/great-domestic-ui | e4c1e4783d7321e170ecb6fd5f9eb6c30cd21f4c | [
"MIT"
] | 3 | 2019-03-11T12:04:22.000Z | 2020-11-12T15:28:13.000Z | from unittest import mock
import pytest
from unittest.mock import call, patch
from django.urls import reverse
from core.tests.helpers import create_response
from content.views import MarketsPageView
@pytest.fixture
def mock_get_page():
stub = patch('directory_cms_client.client.cms_api_client.lookup_by_slug', re... | 30.490196 | 111 | 0.550411 |
e8aac9cfa0d850d20c8399e80ceee70cbf82de6f | 3,091 | py | Python | plantcv/plantcv/morphology/segment_angle.py | Howzit123/plantcv | b4ff6ad765da36353f40827ce3816b33d1d3596a | [
"MIT"
] | 1 | 2021-02-25T16:57:45.000Z | 2021-02-25T16:57:45.000Z | plantcv/plantcv/morphology/segment_angle.py | Howzit123/plantcv | b4ff6ad765da36353f40827ce3816b33d1d3596a | [
"MIT"
] | null | null | null | plantcv/plantcv/morphology/segment_angle.py | Howzit123/plantcv | b4ff6ad765da36353f40827ce3816b33d1d3596a | [
"MIT"
] | null | null | null | # Find angles in degrees of skeleton segments
import os
import cv2
import numpy as np
import pandas as pd
from plantcv.plantcv import params
from plantcv.plantcv import outputs
from plantcv.plantcv import plot_image
from plantcv.plantcv import print_image
from plantcv.plantcv import color_palette
def segment_angle(s... | 34.344444 | 113 | 0.630864 |
4a8a8e611340b041e0f695ebcee9f634c1d67189 | 373 | py | Python | src/week5/week5a_quizz_question8.py | hemmerling/python-coursera2012 | 1828dc26c196dbd7d4a20d207e996bd8ce99c525 | [
"Apache-2.0"
] | null | null | null | src/week5/week5a_quizz_question8.py | hemmerling/python-coursera2012 | 1828dc26c196dbd7d4a20d207e996bd8ce99c525 | [
"Apache-2.0"
] | null | null | null | src/week5/week5a_quizz_question8.py | hemmerling/python-coursera2012 | 1828dc26c196dbd7d4a20d207e996bd8ce99c525 | [
"Apache-2.0"
] | null | null | null | def is_ascending(numbers):
"""Returns whether the given list of numbers is in ascending order."""
for i in range(len(numbers) - 1):
if numbers[i+1] < numbers[i]:
return False
return True
global_numbers = [2, 6, 9, 12, 400]
print is_ascending(global_numbers)
global_numbers = [... | 26.642857 | 75 | 0.643432 |
706cffe80a2533e73684e333a8a33826ea256374 | 4,885 | py | Python | Plots/MapProjections/NCL_sat_2.py | learn2free/GeoCAT-examples | 3ac152a767e78a362a8ebb6f677005f3de320ca6 | [
"Apache-2.0"
] | 1 | 2021-05-09T02:54:10.000Z | 2021-05-09T02:54:10.000Z | Plots/MapProjections/NCL_sat_2.py | learn2free/GeoCAT-examples | 3ac152a767e78a362a8ebb6f677005f3de320ca6 | [
"Apache-2.0"
] | null | null | null | Plots/MapProjections/NCL_sat_2.py | learn2free/GeoCAT-examples | 3ac152a767e78a362a8ebb6f677005f3de320ca6 | [
"Apache-2.0"
] | null | null | null | """
NCL_sat_2.py
===============
This script illustrates the following concepts:
- Converting float data into short data
- Drawing filled contours over a satellite map
- Explicitly setting contour fill colors
- Finding local high pressure values
See following URLs to see the reproduced NCL plot & script:
... | 33.923611 | 82 | 0.581781 |
24bc41244045ec9e45ad94208d6544ca46f8d4c9 | 7,815 | py | Python | project/eeg_pca.py | boredStats/eeg-machine-learning | bbf72ef55644f3941120f8f9007d839c1a4731fd | [
"MIT"
] | 1 | 2020-07-31T11:38:53.000Z | 2020-07-31T11:38:53.000Z | project/eeg_pca.py | boredStats/eeg-machine-learning | bbf72ef55644f3941120f8f9007d839c1a4731fd | [
"MIT"
] | null | null | null | project/eeg_pca.py | boredStats/eeg-machine-learning | bbf72ef55644f3941120f8f9007d839c1a4731fd | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Running PCAs on connectivity data."""
import os
import numpy as np
import pandas as pd
import matplotlib as mpl
import matplotlib.pyplot as plt
import proj_utils as pu
from sklearn.decomposition import PCA, IncrementalPCA
from sklearn.model_selection import cross_val_score
from sklearn.utils... | 30.173745 | 80 | 0.654511 |
2961e7bc3c5b2709b1402ca5f1d1b06e704e5b35 | 1,406 | py | Python | src/emit_started_event.py | duyhoang15/test | 75a22b77adf8f582b40595654cb7200da32b700e | [
"MIT-0"
] | 8 | 2021-02-04T13:16:01.000Z | 2021-09-06T21:38:04.000Z | src/emit_started_event.py | duyhoang15/test | 75a22b77adf8f582b40595654cb7200da32b700e | [
"MIT-0"
] | null | null | null | src/emit_started_event.py | duyhoang15/test | 75a22b77adf8f582b40595654cb7200da32b700e | [
"MIT-0"
] | 12 | 2021-02-04T17:49:03.000Z | 2022-03-07T18:30:02.000Z | import sys
import boto3 # type: ignore
import logging
import json
from awsglue.utils import getResolvedOptions # type: ignore
# Setup Logging
def setup_logger(log_level):
log_msg_format = '%(asctime)s %(levelname)s %(name)s: %(message)s'
log_datetime_format = '%Y-%m-%d %H:%M:%S'
logging.basicConfig(form... | 28.12 | 98 | 0.714083 |
5015bde98f851d89920c327262db0dcdc2227ef7 | 2,862 | py | Python | tests/dic2owl/test_dic2owl_generator.py | emmo-repo/CIF-ontology | 84142714e7db60c87dbd60aabcdc07102d5d8678 | [
"CC-BY-4.0"
] | 5 | 2021-04-28T14:07:49.000Z | 2022-02-17T08:17:06.000Z | tests/dic2owl/test_dic2owl_generator.py | emmo-repo/CIF-ontology | 84142714e7db60c87dbd60aabcdc07102d5d8678 | [
"CC-BY-4.0"
] | 42 | 2021-04-09T12:50:35.000Z | 2022-03-25T09:31:20.000Z | tests/dic2owl/test_dic2owl_generator.py | emmo-repo/CIF-ontology | 84142714e7db60c87dbd60aabcdc07102d5d8678 | [
"CC-BY-4.0"
] | 2 | 2021-04-28T08:47:35.000Z | 2021-08-25T12:03:50.000Z | """Test the `dic2owl.dic2owl.Generator` class."""
# pylint: disable=redefined-outer-name,import-outside-toplevel
from pathlib import Path
from typing import TYPE_CHECKING
import pytest
if TYPE_CHECKING:
from typing import Callable, List, Optional
from dic2owl import Generator
@pytest.fixture(scope="session... | 30.774194 | 79 | 0.706499 |
142e4ca76f757b49b1efa97d742664729184bbfb | 34,624 | py | Python | nempy/spot_markert_backend/solver_interface.py | hy3440/nempy | ffc6c3e1a0becde8cbf6ba56d5885768dc1c0a37 | [
"BSD-3-Clause"
] | 24 | 2020-05-16T11:46:25.000Z | 2022-03-29T22:25:09.000Z | nempy/spot_markert_backend/solver_interface.py | hy3440/nempy | ffc6c3e1a0becde8cbf6ba56d5885768dc1c0a37 | [
"BSD-3-Clause"
] | 6 | 2020-11-17T22:37:35.000Z | 2022-03-03T00:11:08.000Z | nempy/spot_markert_backend/solver_interface.py | hy3440/nempy | ffc6c3e1a0becde8cbf6ba56d5885768dc1c0a37 | [
"BSD-3-Clause"
] | 12 | 2020-04-30T09:42:22.000Z | 2022-03-06T23:45:08.000Z | import numpy as np
import pandas as pd
from mip import Model, xsum, minimize, CONTINUOUS, OptimizationStatus, BINARY, CBC, GUROBI, LP_Method
class InterfaceToSolver:
"""A wrapper for the mip model class, allows interaction with mip using pd.DataFrames."""
def __init__(self, solver_name='CBC'):
self.v... | 41.765983 | 120 | 0.521026 |
bf218ee2349f7a63726c31d479b9661ac719c84a | 2,237 | py | Python | epytope/Data/pssms/comblibsidney/mat/B_1501_9.py | christopher-mohr/epytope | 8ac9fe52c0b263bdb03235a5a6dffcb72012a4fd | [
"BSD-3-Clause"
] | 7 | 2021-02-01T18:11:28.000Z | 2022-01-31T19:14:07.000Z | epytope/Data/pssms/comblibsidney/mat/B_1501_9.py | christopher-mohr/epytope | 8ac9fe52c0b263bdb03235a5a6dffcb72012a4fd | [
"BSD-3-Clause"
] | 22 | 2021-01-02T15:25:23.000Z | 2022-03-14T11:32:53.000Z | epytope/Data/pssms/comblibsidney/mat/B_1501_9.py | christopher-mohr/epytope | 8ac9fe52c0b263bdb03235a5a6dffcb72012a4fd | [
"BSD-3-Clause"
] | 4 | 2021-05-28T08:50:38.000Z | 2022-03-14T11:45:32.000Z | B_1501_9 = {0: {'A': -0.31, 'C': -0.19, 'E': -0.16, 'D': -0.042, 'G': -0.43, 'F': -0.59, 'I': -1.0, 'H': -0.59, 'K': -0.39, 'M': -0.89, 'L': -0.61, 'N': -0.22, 'Q': -0.25, 'P': -0.059, 'S': -0.42, 'R': -0.67, 'T': -0.13, 'W': -0.44, 'V': -0.14, 'Y': -0.33}, 1: {'A': -0.57, 'C': -0.027, 'E': -0.2, 'D': -0.0094, 'G': -0.... | 2,237 | 2,237 | 0.338847 |
63c52b8a164c321004f8a54c113eb69d1180ced8 | 1,973 | py | Python | face_detect/sample/learning_opencv3_with_python_sample/Chapter 7_Code/car_sliding_windows.py | minatuyang/RASP-ATTA | e182248da2f9f131e4e1aca5a2198b6ae910424e | [
"MIT"
] | 1 | 2018-11-14T02:54:24.000Z | 2018-11-14T02:54:24.000Z | face_detect/sample/learning_opencv3_with_python_sample/Chapter 7_Code/car_sliding_windows.py | minatuyang/RASP-ATTA | e182248da2f9f131e4e1aca5a2198b6ae910424e | [
"MIT"
] | null | null | null | face_detect/sample/learning_opencv3_with_python_sample/Chapter 7_Code/car_sliding_windows.py | minatuyang/RASP-ATTA | e182248da2f9f131e4e1aca5a2198b6ae910424e | [
"MIT"
] | null | null | null | import cv2
import numpy as np
from car_detector.detector import car_detector, bow_features
from car_detector.pyramid import pyramid
from car_detector.non_maximum import non_max_suppression_fast as nms
from car_detector.sliding_window import sliding_window
import urllib
def in_range(number, test, thresh=0.2):
return ... | 31.31746 | 136 | 0.670046 |
6d16fc43f9a93d490e299253f3061c3c50459b24 | 2,751 | py | Python | hpa_src/models/inception.py | s6juncheng/HumanProteinAtlas | 00b8c194133790c9e092339dfb9908d682ea9c87 | [
"MIT"
] | null | null | null | hpa_src/models/inception.py | s6juncheng/HumanProteinAtlas | 00b8c194133790c9e092339dfb9908d682ea9c87 | [
"MIT"
] | null | null | null | hpa_src/models/inception.py | s6juncheng/HumanProteinAtlas | 00b8c194133790c9e092339dfb9908d682ea9c87 | [
"MIT"
] | null | null | null | ## My version of InceptionResNetV2 with larger input image
import torch.utils.model_zoo as model_zoo
from pretrainedmodels.models.inceptionresnetv2 import InceptionResNetV2, pretrained_settings
import torch.nn as nn
class MyInceptionResNetV2(InceptionResNetV2):
def __init__(self, *args, **kwargs):
super(M... | 37.684932 | 94 | 0.640494 |
54666d3e365b502e0fe693f6efa6697e2863a925 | 14,866 | py | Python | KernTool3.roboFontExt/lib/tdExceptionView.py | typedev/KernTool3 | f95e2107b56d65429365f38dd43b222940d5025d | [
"MIT"
] | 3 | 2021-02-04T23:28:59.000Z | 2021-02-26T11:26:45.000Z | KernTool3.roboFontExt/lib/tdExceptionView.py | typedev/KernTool3 | f95e2107b56d65429365f38dd43b222940d5025d | [
"MIT"
] | null | null | null | KernTool3.roboFontExt/lib/tdExceptionView.py | typedev/KernTool3 | f95e2107b56d65429365f38dd43b222940d5025d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import sys
# from math import *
from vanilla import *
from mojo.UI import *
from fontParts.world import CurrentFont, RGlyph
from defconAppKit.windows.baseWindow import BaseWindowController
from mojo.canvas import Canvas
from mojo.drawingTools import *
from mojo.glyphPreview import GlyphPreview
... | 30.154158 | 107 | 0.638571 |
28d5ac18dcfe2639b15e819f969cdb50f586e622 | 125 | py | Python | nimbro_service_transport/scripts/get_md5.py | lsolanka-flya/nimbro_network | 13768a9971ea91ce081c4774fb7fecfc4c323912 | [
"BSD-3-Clause"
] | 105 | 2015-09-22T14:36:32.000Z | 2022-03-09T08:51:43.000Z | nimbro_service_transport/scripts/get_md5.py | tradr-project/nimbro_network | 97e15d7d4c0d1a56fa85cdc62da13b00ef5275a9 | [
"BSD-3-Clause"
] | 19 | 2015-09-25T23:23:39.000Z | 2021-11-04T16:59:49.000Z | nimbro_service_transport/scripts/get_md5.py | tradr-project/nimbro_network | 97e15d7d4c0d1a56fa85cdc62da13b00ef5275a9 | [
"BSD-3-Clause"
] | 33 | 2015-09-25T18:11:31.000Z | 2022-03-23T06:55:28.000Z | #!/usr/bin/python
import roslib.message
import sys
sys.stdout.write(roslib.message.get_service_class(sys.argv[1])._md5sum)
| 17.857143 | 71 | 0.792 |
599d9122ced23f1433235fd8ef8056a1d9e52de0 | 5,190 | py | Python | simple_site_checker.py | terryBaz/Simple-Site-Checker | 0343c3b13cd46c2fe61a91d9378a41d2c46c4760 | [
"BSD-3-Clause"
] | null | null | null | simple_site_checker.py | terryBaz/Simple-Site-Checker | 0343c3b13cd46c2fe61a91d9378a41d2c46c4760 | [
"BSD-3-Clause"
] | null | null | null | simple_site_checker.py | terryBaz/Simple-Site-Checker | 0343c3b13cd46c2fe61a91d9378a41d2c46c4760 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
import argparse
from datetime import datetime
import logging
import os
import sys
import urllib.request, urllib.error, urllib.parse
from lxml import etree
USER_AGENT = ''
SITEMAP_NAMESPACE = 'http://www.sitemaps.org/schemas/sitemap/0.9'
XMLNS = {'sitemap': SITEMAP_NAMESPACE}
DATETIME_FORMAT =... | 33.057325 | 149 | 0.587476 |
320f0c665346cd5d19578bebbc23369ee768006b | 3,098 | py | Python | env_1.py | jcostacurta11/panda-env | 519733eb329ced3fffd2a957e0c526ded66f0ae0 | [
"MIT"
] | 5 | 2020-09-10T08:40:37.000Z | 2021-08-10T09:47:41.000Z | env_1.py | jcostacurta11/panda-env | 519733eb329ced3fffd2a957e0c526ded66f0ae0 | [
"MIT"
] | null | null | null | env_1.py | jcostacurta11/panda-env | 519733eb329ced3fffd2a957e0c526ded66f0ae0 | [
"MIT"
] | 2 | 2020-10-05T19:06:34.000Z | 2021-08-07T11:08:13.000Z | import os
import numpy as np
import pybullet as p
import pybullet_data
from panda import Panda
from objects import YCBObject, InteractiveObj, RBOObject
class SimpleEnv():
def __init__(self):
# create simulation (GUI)
self.urdfRootPath = pybullet_data.getDataPath()
p.connect(p.GUI)
... | 38.246914 | 109 | 0.496449 |
4a032be5d1b43e725143b0c597cc83f0af62e150 | 10,964 | py | Python | citation_graph.py | Azzaare/multiplex-carbonara | c911bd08aa4120a3ebf099b03eb1fa1670a3a255 | [
"MIT"
] | null | null | null | citation_graph.py | Azzaare/multiplex-carbonara | c911bd08aa4120a3ebf099b03eb1fa1670a3a255 | [
"MIT"
] | null | null | null | citation_graph.py | Azzaare/multiplex-carbonara | c911bd08aa4120a3ebf099b03eb1fa1670a3a255 | [
"MIT"
] | null | null | null | import os
from py2neo import Graph, Node, Relationship, authenticate
#lists and tables required to parse the date
months = {
"jan": 1,
"january": 1,
"feb": 2,
"february": 2,
"mar": 3,
"march": 3,
"apr": 4,
"april": 4,
"may": 5,
"jun": 6,
... | 40.758364 | 225 | 0.513134 |
9d2e66567145a7a89fe9bfc9f74ef5a90ea1db40 | 367 | py | Python | Algo and DSA/LeetCode-Solutions-master/Python/thousand-separator.py | Sourav692/FAANG-Interview-Preparation | f523e5c94d582328b3edc449ea16ac6ab28cdc81 | [
"Unlicense"
] | 3,269 | 2018-10-12T01:29:40.000Z | 2022-03-31T17:58:41.000Z | Algo and DSA/LeetCode-Solutions-master/Python/thousand-separator.py | Sourav692/FAANG-Interview-Preparation | f523e5c94d582328b3edc449ea16ac6ab28cdc81 | [
"Unlicense"
] | 53 | 2018-12-16T22:54:20.000Z | 2022-02-25T08:31:20.000Z | Algo and DSA/LeetCode-Solutions-master/Python/thousand-separator.py | Sourav692/FAANG-Interview-Preparation | f523e5c94d582328b3edc449ea16ac6ab28cdc81 | [
"Unlicense"
] | 1,236 | 2018-10-12T02:51:40.000Z | 2022-03-30T13:30:37.000Z | # Time: O(n)
# Space: O(1)
class Solution(object):
def thousandSeparator(self, n):
"""
:type n: int
:rtype: str
"""
result = []
s = str(n)
for i, c in enumerate(str(n)):
if i and (len(s)-i)%3 == 0:
result.append(".")
r... | 21.588235 | 39 | 0.430518 |
6a578ad3665703fc3b6411a96fc3eedd49fe790f | 3,201 | py | Python | graalpython/com.oracle.graal.python.test/src/tests/test_mro.py | qunaibit/graalpython | 7676d10af92f5a7ddb2ca04efc11cabae4957930 | [
"UPL-1.0",
"Apache-2.0",
"OpenSSL"
] | null | null | null | graalpython/com.oracle.graal.python.test/src/tests/test_mro.py | qunaibit/graalpython | 7676d10af92f5a7ddb2ca04efc11cabae4957930 | [
"UPL-1.0",
"Apache-2.0",
"OpenSSL"
] | null | null | null | graalpython/com.oracle.graal.python.test/src/tests/test_mro.py | qunaibit/graalpython | 7676d10af92f5a7ddb2ca04efc11cabae4957930 | [
"UPL-1.0",
"Apache-2.0",
"OpenSSL"
] | null | null | null | # Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# The Universal Permissive License (UPL), Version 1.0
#
# Subject to the condition set forth below, permission is hereby granted to any
# person obtaining a copy of this software, a... | 26.89916 | 79 | 0.669166 |
1f3ca56cad56109b0d17580ee76564c9661e831f | 502 | py | Python | ExtractTable/config.py | rbm897/ExtractTable-py | cfb7d313d9e466f570c315e53eab673ea9926aab | [
"Apache-2.0"
] | null | null | null | ExtractTable/config.py | rbm897/ExtractTable-py | cfb7d313d9e466f570c315e53eab673ea9926aab | [
"Apache-2.0"
] | null | null | null | ExtractTable/config.py | rbm897/ExtractTable-py | cfb7d313d9e466f570c315e53eab673ea9926aab | [
"Apache-2.0"
] | null | null | null | """
Configure all Server request/response objects here
"""
class HOST:
"""API Endpoints of ExtractTable.com"""
VALIDATOR = 'validator.extracttable.com'
TRIGGER = 'trigger.extracttable.com'
RESULT = 'getresult.extracttable.com'
BIGFILE = 'bigfile.extracttable.com'
class JobStatus:
"""Job Stat... | 25.1 | 90 | 0.701195 |
6d88a2194a4f07a858c91228ecbf144667c5e138 | 1,622 | py | Python | data_profiler/tests/labelers/test_integration_regex_data_labeler.py | taylorfturner/data-profiler | da416d1ccaed4b04d2e5b93da41a508de58b642e | [
"Apache-2.0"
] | 1 | 2021-02-13T21:53:16.000Z | 2021-02-13T21:53:16.000Z | data_profiler/tests/labelers/test_integration_regex_data_labeler.py | taylorfturner/data-profiler | da416d1ccaed4b04d2e5b93da41a508de58b642e | [
"Apache-2.0"
] | null | null | null | data_profiler/tests/labelers/test_integration_regex_data_labeler.py | taylorfturner/data-profiler | da416d1ccaed4b04d2e5b93da41a508de58b642e | [
"Apache-2.0"
] | null | null | null | import os
import unittest
import pkg_resources
import numpy as np
from data_profiler.labelers.data_labelers import BaseDataLabeler
default_labeler_dir = pkg_resources.resource_filename(
'resources', 'labelers'
)
class TestRegexDataLabeler(unittest.TestCase):
@classmethod
def setUpClass(cls) -> None:
... | 28.45614 | 71 | 0.670777 |
2d1f05011776b530770e1aa3f50f1d4b66d1d596 | 2,138 | py | Python | commands/profile.py | SSwiftGamer440/Synergile | 22a0879f292b8fea056373633f9f956ae82fc609 | [
"MIT"
] | 5 | 2020-05-25T20:30:54.000Z | 2021-03-29T10:23:56.000Z | commands/profile.py | SSwiftGamer440/Synergile | 22a0879f292b8fea056373633f9f956ae82fc609 | [
"MIT"
] | 43 | 2020-05-24T21:11:07.000Z | 2021-04-03T09:18:40.000Z | commands/profile.py | SSwiftGamer440/Synergile | 22a0879f292b8fea056373633f9f956ae82fc609 | [
"MIT"
] | 1 | 2020-05-23T00:04:10.000Z | 2020-05-23T00:04:10.000Z | import math
import discord
from discord.ext import commands
from datetime import datetime
from datetime import timezone
from util.pyutil import buildMultiMatchString
from util.discordutil import resolveMember
class Profile(commands.Cog, name='Profile'):
def __init__(self, bot):
self.bot = bot
@commands.command(d... | 39.592593 | 120 | 0.739008 |
8238ff17b248bc15ddfb8f8e62a4a6e5d0836234 | 1,000 | py | Python | setup.py | nthdegreeburns/pysolr | b8c68d658de46084166b331d41491b681843b8b1 | [
"BSD-3-Clause"
] | null | null | null | setup.py | nthdegreeburns/pysolr | b8c68d658de46084166b331d41491b681843b8b1 | [
"BSD-3-Clause"
] | null | null | null | setup.py | nthdegreeburns/pysolr | b8c68d658de46084166b331d41491b681843b8b1 | [
"BSD-3-Clause"
] | null | null | null | try:
from setuptools import setup
except ImportError:
from distutils.core import setup
setup(
name="pysolr",
version="3.5.0",
description="Lightweight python wrapper for Apache Solr.",
author='Daniel Lindsley',
author_email='daniel@toastdriven.com',
long_description=open('README.rst', ... | 26.315789 | 62 | 0.589 |
8af9fdb42c8e51bdee96875b8406a113383f474e | 920 | py | Python | src/zerohunger/accounts/migrations/0004_auto_20200531_2139.py | BuildForSDG/Team-250-Backends | 1a81e20e3a01f909f26966070db5c9acc508838d | [
"MIT"
] | null | null | null | src/zerohunger/accounts/migrations/0004_auto_20200531_2139.py | BuildForSDG/Team-250-Backends | 1a81e20e3a01f909f26966070db5c9acc508838d | [
"MIT"
] | 16 | 2020-05-27T20:04:04.000Z | 2021-09-22T19:07:34.000Z | src/zerohunger/accounts/migrations/0004_auto_20200531_2139.py | BuildForSDG/Team-250-Backends | 1a81e20e3a01f909f26966070db5c9acc508838d | [
"MIT"
] | 1 | 2020-05-17T00:02:57.000Z | 2020-05-17T00:02:57.000Z | # Generated by Django 3.0.6 on 2020-05-31 20:39
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('accounts', '0003_auto_20200528_2033'),
]
operations = [
migrations.AlterField(
model_name='user',
name='is_active',
... | 28.75 | 77 | 0.551087 |
4d2986de890c3b48ae0c87fff80715b096960c58 | 157 | py | Python | fist_phase/0503_chicken.py | kapuni/exercise_py | b60ba8462d2545cae57483bcb0b3428b03c5d522 | [
"MIT"
] | null | null | null | fist_phase/0503_chicken.py | kapuni/exercise_py | b60ba8462d2545cae57483bcb0b3428b03c5d522 | [
"MIT"
] | null | null | null | fist_phase/0503_chicken.py | kapuni/exercise_py | b60ba8462d2545cae57483bcb0b3428b03c5d522 | [
"MIT"
] | null | null | null | for x in range(20):
for y in range(33):
z = 100 - x - y
if 5*x + 3*y + z/3 == 100:
print("公鸡:%d只,母鸡:%d只, 小鸡:%d只" % (x, y, z)) | 31.4 | 54 | 0.401274 |
c306a081db56bbc06f498efe1fcc66faa5a02dfd | 775 | py | Python | hello_python_source_py3/py2to3_converter.py | AnthonyBriggs/Python-101 | e6c7584fd6791bb5d7d05fd419faa46dc7148f61 | [
"MIT"
] | 3 | 2017-08-02T23:40:55.000Z | 2018-07-02T14:59:07.000Z | hello_python_source_py3/py2to3_converter.py | AnthonyBriggs/Python-101 | e6c7584fd6791bb5d7d05fd419faa46dc7148f61 | [
"MIT"
] | null | null | null | hello_python_source_py3/py2to3_converter.py | AnthonyBriggs/Python-101 | e6c7584fd6791bb5d7d05fd419faa46dc7148f61 | [
"MIT"
] | null | null | null |
"""Script to mass-convert all the Python 2 files in a directory to Python 3."""
import os
import sys
try:
target = sys.argv[1]
if target.endswith('"'):
target = target[:-1]
except IndexError:
target = "."
print(target)
#sys.exit(1) # debug
for path, dirs, files in os.walk(target):
print(... | 26.724138 | 79 | 0.603871 |
1b3932b86052b68dd1bca488a0afc1f8c31f9328 | 43,862 | py | Python | third_party/python/Lib/test/test_codeccallbacks.py | appotry/cosmopolitan | af4687cc3f2331a23dc336183ab58fe001cda082 | [
"ISC"
] | null | null | null | third_party/python/Lib/test/test_codeccallbacks.py | appotry/cosmopolitan | af4687cc3f2331a23dc336183ab58fe001cda082 | [
"ISC"
] | null | null | null | third_party/python/Lib/test/test_codeccallbacks.py | appotry/cosmopolitan | af4687cc3f2331a23dc336183ab58fe001cda082 | [
"ISC"
] | null | null | null | import codecs
import html.entities
import sys
import test.support
import unicodedata
import unittest
from encodings import raw_unicode_escape
class PosReturn:
# this can be used for configurable callbacks
def __init__(self):
self.pos = 0
def handle(self, exc):
oldpos = self.pos
re... | 38.988444 | 120 | 0.547946 |
d873d81111cc48c1055dc203f6cab674ffb91b88 | 12,417 | py | Python | ppcls/arch/backbone/model_zoo/se_resnext.py | qili93/PaddleClas | 21a89ee365613890b601001343a6bef2cbd99c2c | [
"Apache-2.0"
] | 2 | 2021-06-22T06:28:20.000Z | 2021-06-22T06:28:23.000Z | ppcls/arch/backbone/model_zoo/se_resnext.py | sunjianfengHub/PaddleClas | dad9fa8b54da97691d2c7f2b6e0c2b4f077177b7 | [
"Apache-2.0"
] | null | null | null | ppcls/arch/backbone/model_zoo/se_resnext.py | sunjianfengHub/PaddleClas | dad9fa8b54da97691d2c7f2b6e0c2b4f077177b7 | [
"Apache-2.0"
] | 1 | 2021-06-25T17:50:30.000Z | 2021-06-25T17:50:30.000Z | # copyright (c) 2020 PaddlePaddle Authors. All Rights Reserve.
#
# 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... | 36.201166 | 137 | 0.575099 |
340d5b281329c2be502e47998df22bfc7c3ebc54 | 9,652 | py | Python | core/models/base_models/resnetv1b.py | achaiah/awesome-semantic-segmentation-pytorch | 4f945a1989ae8b1bb6b24f1214fa84a7ca8c8e07 | [
"Apache-2.0"
] | 1 | 2019-09-09T16:58:48.000Z | 2019-09-09T16:58:48.000Z | core/models/base_models/resnetv1b.py | achaiah/awesome-semantic-segmentation-pytorch | 4f945a1989ae8b1bb6b24f1214fa84a7ca8c8e07 | [
"Apache-2.0"
] | null | null | null | core/models/base_models/resnetv1b.py | achaiah/awesome-semantic-segmentation-pytorch | 4f945a1989ae8b1bb6b24f1214fa84a7ca8c8e07 | [
"Apache-2.0"
] | 1 | 2019-12-04T03:06:07.000Z | 2019-12-04T03:06:07.000Z | import torch
import torch.nn as nn
import torch.utils.model_zoo as model_zoo
__all__ = ['ResNetV1b', 'resnet18_v1b', 'resnet34_v1b', 'resnet50_v1b',
'resnet101_v1b', 'resnet152_v1b', 'resnet152_v1s', 'resnet101_v1s', 'resnet50_v1s']
model_urls = {
'resnet18': 'https://download.pytorch.org/models/resnet... | 36.560606 | 110 | 0.612516 |
fe536215881302676ce4056998bfa8b5e33f225b | 6,145 | py | Python | common/hobbies.py | oserikov/dream | 109ba2df799025dcdada1fddbb7380e1c03100eb | [
"Apache-2.0"
] | 34 | 2021-08-18T14:51:44.000Z | 2022-03-10T14:14:48.000Z | common/hobbies.py | oserikov/dream | 109ba2df799025dcdada1fddbb7380e1c03100eb | [
"Apache-2.0"
] | 27 | 2021-08-30T14:42:09.000Z | 2022-03-17T22:11:45.000Z | common/hobbies.py | oserikov/dream | 109ba2df799025dcdada1fddbb7380e1c03100eb | [
"Apache-2.0"
] | 40 | 2021-08-22T07:13:32.000Z | 2022-03-29T11:45:32.000Z | import re
HOBBIES_RE = re.compile(
r"\b(Acroyoga|Acting|Aerial silk|Airbrushing|Amateur radio"
"|Animation|Aquascaping|Art|Astrology|Babysitting|Baking"
"|Basketball|Baton twirling|Beatboxing|Beer sommelier"
"|Beer tasting|Binge-watching|Blogging|Board game|Board games"
"|Book discussion club|Book ... | 76.8125 | 94 | 0.799512 |
8626dded68250016d34f68569199572890b81bb5 | 1,056 | py | Python | Course_1/Week_4/list_comprehensions.py | internetworksio/Google-ITAutomation-Python | 6027750a33e8df883d762223bb0c4a5a95395bc0 | [
"MIT"
] | 2 | 2021-03-23T16:02:32.000Z | 2022-03-13T09:32:56.000Z | Course_1/Week_4/list_comprehensions.py | internetworksio/Google-ITAutomation-Python | 6027750a33e8df883d762223bb0c4a5a95395bc0 | [
"MIT"
] | null | null | null | Course_1/Week_4/list_comprehensions.py | internetworksio/Google-ITAutomation-Python | 6027750a33e8df883d762223bb0c4a5a95395bc0 | [
"MIT"
] | 7 | 2021-01-14T05:39:54.000Z | 2022-03-13T09:33:01.000Z | """
This script is used for course notes.
Author: Erick Marin
Date: 10/20/2020
"""
multiples = []
for x in range(1, 11):
multiples.append(x*7)
print(multiples)
# List comprehension method
# Let us create new lists based on sequences or ranges
multiples = [x * 7 for x in range(1, 11)]
print(multiples)
languages... | 25.756098 | 77 | 0.673295 |
1dc9c5cba0062cf70ffb672c5ade6c7c7b3b8f35 | 1,721 | py | Python | qr.py | chenyuyou/qr_website | 7124013089591217e2b14a3b239656bbe5cd1254 | [
"MIT"
] | null | null | null | qr.py | chenyuyou/qr_website | 7124013089591217e2b14a3b239656bbe5cd1254 | [
"MIT"
] | null | null | null | qr.py | chenyuyou/qr_website | 7124013089591217e2b14a3b239656bbe5cd1254 | [
"MIT"
] | null | null | null | import qrcode
from MyQR import myqr
from PIL import Image
def QR_With_Central_Img(link="http://192.168.50.126:8000", central_picture="BackgroudIMG.png", output_file="output_code.png"):
qr = qrcode.QRCode(version=1, error_correction=qrcode.constants.ERROR_CORRECT_H, box_size=10, border=2)
content = link
qr.add_data(... | 27.758065 | 134 | 0.727484 |
9f4c443cbb65e4e69d441e00dc0026e3ac82ea9b | 1,490 | py | Python | isurveyAPI.py | kalcanfor/chatbot-iesb | 270bd635e8c4f651e8d1593a368bcb13825de53a | [
"MIT"
] | null | null | null | isurveyAPI.py | kalcanfor/chatbot-iesb | 270bd635e8c4f651e8d1593a368bcb13825de53a | [
"MIT"
] | null | null | null | isurveyAPI.py | kalcanfor/chatbot-iesb | 270bd635e8c4f651e8d1593a368bcb13825de53a | [
"MIT"
] | 1 | 2021-11-15T18:41:32.000Z | 2021-11-15T18:41:32.000Z | import requests
import json
import pandas as pd
from unicodedata import normalize
import base64
class ApiISurvey:
def __init__(self, username, password):
self.urltoken = "http://portalh.cgee.org.br:6443/cas/v1/tickets?service=https://isurvey.cgee.org.br/iSurveyConfigurador/"
self.payload = {
... | 35.47619 | 152 | 0.604027 |
b7b7133065972ee3fab2e7c9830d780f745a01d3 | 2,088 | py | Python | collections/ansible_collections/ansible/tower/plugins/modules/tower_license.py | hindman-redhat/automated-smart-management-2 | 5450ccd71f2a4ba568a7f11b03466e1554ae0087 | [
"MIT"
] | null | null | null | collections/ansible_collections/ansible/tower/plugins/modules/tower_license.py | hindman-redhat/automated-smart-management-2 | 5450ccd71f2a4ba568a7f11b03466e1554ae0087 | [
"MIT"
] | null | null | null | collections/ansible_collections/ansible/tower/plugins/modules/tower_license.py | hindman-redhat/automated-smart-management-2 | 5450ccd71f2a4ba568a7f11b03466e1554ae0087 | [
"MIT"
] | 2 | 2021-03-30T14:26:02.000Z | 2021-04-01T18:17:29.000Z | #!/usr/bin/python
# coding: utf-8 -*-
# (c) 2019, John Westcott IV <john.westcott.iv@redhat.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '... | 24.564706 | 102 | 0.64272 |
30ebe58e0893fdac61603d5336538939297690f5 | 209 | py | Python | train/siamese/utilities/__init__.py | openem-team/openem | 45222c9c77084eacab278da25a8734ae7d43f677 | [
"MIT"
] | 10 | 2019-01-23T23:58:01.000Z | 2021-08-30T19:42:35.000Z | train/siamese/utilities/__init__.py | openem-team/openem | 45222c9c77084eacab278da25a8734ae7d43f677 | [
"MIT"
] | 3 | 2020-03-20T15:21:41.000Z | 2020-09-18T18:49:38.000Z | train/siamese/utilities/__init__.py | openem-team/openem | 45222c9c77084eacab278da25a8734ae7d43f677 | [
"MIT"
] | 2 | 2020-05-08T17:39:12.000Z | 2020-10-09T01:27:17.000Z | from utilities.utilities import *
from utilities.track_data import *
from utilities.class_data import *
from utilities.count_data import *
from utilities.model_data import *
from utilities.detid_data import *
| 29.857143 | 34 | 0.827751 |
db0df3c0f0e8081463caf2869cdb2901b289fdb7 | 1,042 | py | Python | logtools/__init__.py | adamhadani/logtools | 0b47662179b6d29be5629702e1eaddefb2b281fb | [
"Apache-2.0"
] | 100 | 2015-01-02T18:00:18.000Z | 2022-01-12T09:39:24.000Z | logtools/__init__.py | adamhadani/logtools | 0b47662179b6d29be5629702e1eaddefb2b281fb | [
"Apache-2.0"
] | 2 | 2015-09-16T22:08:22.000Z | 2021-06-12T20:46:05.000Z | logtools/__init__.py | adamhadani/logtools | 0b47662179b6d29be5629702e1eaddefb2b281fb | [
"Apache-2.0"
] | 25 | 2015-01-02T18:00:21.000Z | 2022-03-09T05:47:11.000Z | #!/usr/bin/env python
#
# 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, so... | 27.421053 | 75 | 0.738004 |
f58cf320454e1f144f7f53bb89a10b2316fceec9 | 1,852 | py | Python | configs/ocrnet/fcn_hr48_512x1024_40k_b16_rmi_cityscapes.py | openseg-group/mmsegmentation | 23939f09d2b0bd30fc26eb7f8af974f1f5441210 | [
"Apache-2.0"
] | 2 | 2020-07-10T12:13:56.000Z | 2020-11-09T07:09:29.000Z | configs/ocrnet/fcn_hr48_512x1024_40k_b16_rmi_cityscapes.py | openseg-group/mmsegmentation | 23939f09d2b0bd30fc26eb7f8af974f1f5441210 | [
"Apache-2.0"
] | null | null | null | configs/ocrnet/fcn_hr48_512x1024_40k_b16_rmi_cityscapes.py | openseg-group/mmsegmentation | 23939f09d2b0bd30fc26eb7f8af974f1f5441210 | [
"Apache-2.0"
] | 2 | 2020-07-28T09:12:55.000Z | 2021-01-04T07:49:59.000Z | _base_ = [
'../_base_/datasets/cityscapes.py',
'../_base_/default_runtime.py',
'../_base_/schedules/schedule_40k.py'
]
norm_cfg = dict(type='SyncBN', requires_grad=True)
model = dict(
type='EncoderDecoder',
pretrained='open-mmlab://msra/hrnetv2_w18',
backbone=dict(
type='HRNet',
... | 29.870968 | 61 | 0.515119 |
de1d3ef7f7f54d86a070275471fe7d1638450030 | 10,099 | py | Python | management/views.py | eark-project/access_dipcreator | b1f9034d309dfdb676cbba92c9c4722bf576aba2 | [
"MIT"
] | null | null | null | management/views.py | eark-project/access_dipcreator | b1f9034d309dfdb676cbba92c9c4722bf576aba2 | [
"MIT"
] | null | null | null | management/views.py | eark-project/access_dipcreator | b1f9034d309dfdb676cbba92c9c4722bf576aba2 | [
"MIT"
] | null | null | null | import json
import os
from json import JSONDecodeError
from django.template import loader
from django.views.generic.detail import DetailView
from django.utils.decorators import method_decorator
from django.contrib.auth.decorators import login_required
from shutil import rmtree
from eatb.storage.directorypairtreestora... | 38.253788 | 354 | 0.67373 |
cb2bb86ffa2a0427fc0b7635ab6c77d411cc3a01 | 6,559 | py | Python | kafka/admin_client.py | duruyi/kafka-python | fb00adbd6c985df0780342c207598e01595cc9e2 | [
"Apache-2.0"
] | 20 | 2015-07-17T08:37:05.000Z | 2021-06-01T15:52:16.000Z | kafka/admin_client.py | duruyi/kafka-python | fb00adbd6c985df0780342c207598e01595cc9e2 | [
"Apache-2.0"
] | 26 | 2015-07-09T20:16:23.000Z | 2020-04-03T22:00:38.000Z | kafka/admin_client.py | duruyi/kafka-python | fb00adbd6c985df0780342c207598e01595cc9e2 | [
"Apache-2.0"
] | 14 | 2016-07-01T21:54:00.000Z | 2019-09-24T05:33:07.000Z | import collections
import time
from .errors import NodeNotReadyError
from .protocol.admin import CreateTopicsRequest, DeleteTopicsRequest, CreatePartitionsRequest
from .protocol.metadata import MetadataRequest
"""NewPartitionsInfo
Fields:
name (string): name of topic
count (int): the new partition count
... | 31.382775 | 93 | 0.587894 |
3f76b2169db0d95db05c2188f5c91daeec6e69fa | 8,236 | py | Python | main.py | qibin0506/CarND-Semantic-Segmentation | 1249a18b38b068e224d360eafd8d371c585cd1fd | [
"MIT"
] | null | null | null | main.py | qibin0506/CarND-Semantic-Segmentation | 1249a18b38b068e224d360eafd8d371c585cd1fd | [
"MIT"
] | null | null | null | main.py | qibin0506/CarND-Semantic-Segmentation | 1249a18b38b068e224d360eafd8d371c585cd1fd | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import os.path
import tensorflow as tf
import helper
import warnings
from distutils.version import LooseVersion
import project_tests as tests
# Check TensorFlow Version
assert LooseVersion(tf.__version__) >= LooseVersion('1.0'), 'Please use TensorFlow version 1.0 or newer. You are using {}'.fo... | 45.005464 | 146 | 0.697062 |
d5b7183f364b8a493af78eae5b55c73e13d1e592 | 208 | py | Python | calculator/admin.py | dev-nislam2020/thecalculatorcafe | be5b17888006dccdd3d3311e6bc1a84904cca32e | [
"MIT"
] | null | null | null | calculator/admin.py | dev-nislam2020/thecalculatorcafe | be5b17888006dccdd3d3311e6bc1a84904cca32e | [
"MIT"
] | null | null | null | calculator/admin.py | dev-nislam2020/thecalculatorcafe | be5b17888006dccdd3d3311e6bc1a84904cca32e | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import Tag, Calculator, CalculatorInfo
# Register your models here.
admin.site.register(Tag)
admin.site.register(Calculator)
admin.site.register(CalculatorInfo)
| 26 | 51 | 0.822115 |
2cab6d1668d08a922abd2f5a3c7c6982473cbed6 | 1,335 | py | Python | doge-training/resize-images.py | jb1361/memelon | 98c42f63bbf6447110eb1d6a73da53e5c318ab69 | [
"MIT"
] | 1 | 2021-04-29T20:14:44.000Z | 2021-04-29T20:14:44.000Z | doge-training/resize-images.py | jb1361/memelon | 98c42f63bbf6447110eb1d6a73da53e5c318ab69 | [
"MIT"
] | null | null | null | doge-training/resize-images.py | jb1361/memelon | 98c42f63bbf6447110eb1d6a73da53e5c318ab69 | [
"MIT"
] | 2 | 2021-02-14T02:20:32.000Z | 2021-04-29T20:14:46.000Z | import os
from PIL import Image
import glob
train_path="E:/memelon/doge-training/doge-classification/train/doge"
uniform_size = (600, 600)
i = 0
def checkFileExists(head, filetype):
global i
if os.path.isfile(head + "/" + "resized_" + str(i) + filetype):
i = i + 20
checkFileExists(head, filet... | 29.666667 | 82 | 0.617978 |
e581a43549cc30a2600489732459ce50ffd58a4f | 158 | py | Python | tests/model_control/detailed/transf_Fisher/model_control_one_enabled_Fisher_ConstantTrend_BestCycle_ARX.py | jmabry/pyaf | afbc15a851a2445a7824bf255af612dc429265af | [
"BSD-3-Clause"
] | null | null | null | tests/model_control/detailed/transf_Fisher/model_control_one_enabled_Fisher_ConstantTrend_BestCycle_ARX.py | jmabry/pyaf | afbc15a851a2445a7824bf255af612dc429265af | [
"BSD-3-Clause"
] | 1 | 2019-11-30T23:39:38.000Z | 2019-12-01T04:34:35.000Z | tests/model_control/detailed/transf_Fisher/model_control_one_enabled_Fisher_ConstantTrend_BestCycle_ARX.py | jmabry/pyaf | afbc15a851a2445a7824bf255af612dc429265af | [
"BSD-3-Clause"
] | null | null | null | import pyaf.tests.model_control.test_ozone_custom_models_enabled as testmod
testmod.build_model( ['Fisher'] , ['ConstantTrend'] , ['BestCycle'] , ['ARX'] ); | 39.5 | 80 | 0.746835 |
83e68ffd03e85affd4029c50ae8954c42ae68942 | 4,564 | py | Python | benchmark/startQiskit_QC3143.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startQiskit_QC3143.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startQiskit_QC3143.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | # qubit number=4
# total number=47
import cirq
import qiskit
from qiskit import IBMQ
from qiskit.providers.ibmq import least_busy
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister
from qiskit import BasicAer, execute, transpile
from pprint import pprint
from qiskit.test.mock import FakeVigo
from ma... | 35.379845 | 165 | 0.654689 |
435561c8e80edf26f57dc506c77ee0db124ac0ef | 53,360 | py | Python | salt/transport/zeromq.py | anitakrueger/salt | ffa430507041e18a783444fc379d67b078b5692f | [
"Apache-2.0"
] | 5 | 2018-05-01T20:51:14.000Z | 2021-11-09T05:43:00.000Z | salt/transport/zeromq.py | anitakrueger/salt | ffa430507041e18a783444fc379d67b078b5692f | [
"Apache-2.0"
] | 4 | 2019-02-08T17:53:38.000Z | 2019-06-06T16:17:27.000Z | salt/transport/zeromq.py | anitakrueger/salt | ffa430507041e18a783444fc379d67b078b5692f | [
"Apache-2.0"
] | 7 | 2017-09-29T18:49:53.000Z | 2021-11-09T05:42:49.000Z | # -*- coding: utf-8 -*-
'''
Zeromq transport classes
'''
# Import Python Libs
from __future__ import absolute_import, print_function, unicode_literals
import os
import sys
import copy
import errno
import signal
import socket
import hashlib
import logging
import weakref
import threading
from random import randint
# Im... | 39.613957 | 119 | 0.589599 |
08a3e3fcc68495d87b83e9c80602463438c42fa3 | 6,332 | py | Python | tests/providers/google/cloud/operators/test_mssql_to_gcs.py | ianburrell/airflow | 3de68501b7a76dce24bfd8a8b4659eedcf7ac29c | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 3 | 2015-08-25T13:56:44.000Z | 2020-03-21T10:26:58.000Z | tests/providers/google/cloud/operators/test_mssql_to_gcs.py | ianburrell/airflow | 3de68501b7a76dce24bfd8a8b4659eedcf7ac29c | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 4 | 2016-04-15T12:31:24.000Z | 2020-03-03T12:56:08.000Z | tests/providers/google/cloud/operators/test_mssql_to_gcs.py | santecapital/airflow | 7f02e56c9cb8b548624d13e9c2c2b89d753f996b | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 2 | 2018-07-24T08:54:45.000Z | 2018-08-31T13:41:50.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... | 40.075949 | 106 | 0.689987 |
54bf5fced659879304e12f414d5838f48827cac0 | 1,087 | py | Python | proteus/tests/ci/ladr_2d_n.py | burgreen/proteus | 033bbd3fd0ff11d53d8e85b2da1af49e10af9c5d | [
"MIT"
] | null | null | null | proteus/tests/ci/ladr_2d_n.py | burgreen/proteus | 033bbd3fd0ff11d53d8e85b2da1af49e10af9c5d | [
"MIT"
] | null | null | null | proteus/tests/ci/ladr_2d_n.py | burgreen/proteus | 033bbd3fd0ff11d53d8e85b2da1af49e10af9c5d | [
"MIT"
] | null | null | null | from __future__ import absolute_import
from __future__ import division
from builtins import range
from past.utils import old_div
from proteus import *
from proteus.default_n import *
try:
from .ladr_2d_p import *
except:
from ladr_2d_p import *
timeIntegration = BackwardEuler_cfl
stepController = Min_dt_cfl_co... | 32.939394 | 73 | 0.787489 |
63243699312f37df108d52d3782b6d37c0182123 | 102 | py | Python | run.py | KennyChenFight/AIBox-Server | e2bb4a9afff1db7596741c4084889769510eb27b | [
"MIT"
] | 1 | 2018-10-18T14:48:09.000Z | 2018-10-18T14:48:09.000Z | run.py | KennyChenFight/AIBox-Server | e2bb4a9afff1db7596741c4084889769510eb27b | [
"MIT"
] | null | null | null | run.py | KennyChenFight/AIBox-Server | e2bb4a9afff1db7596741c4084889769510eb27b | [
"MIT"
] | 1 | 2018-09-22T08:18:14.000Z | 2018-09-22T08:18:14.000Z | from app import app
if __name__ == '__main__':
app.run(host='192.168.100.105')
#app.run() | 20.4 | 36 | 0.607843 |
6a95cf9f155a8e4a83e4fe68dba2488c5d3adfe1 | 395 | py | Python | secret.py | Xuechunqiu/cgi-lab | e7d2325ad1b549296b99254c13fa24e260dc3c4f | [
"Apache-2.0"
] | null | null | null | secret.py | Xuechunqiu/cgi-lab | e7d2325ad1b549296b99254c13fa24e260dc3c4f | [
"Apache-2.0"
] | null | null | null | secret.py | Xuechunqiu/cgi-lab | e7d2325ad1b549296b99254c13fa24e260dc3c4f | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: UTF-8 -*-
import cgi
import cgitb
cgitb.enable()
class FollowingTheTAsInstructionsError(Exception):
def __init__(self):
Exception.__init__(self, (
"You must edit secret.py to change the username, password, "
"and to delete this error!"
)... | 20.789474 | 72 | 0.648101 |
e5f2eaf9bd3cea737b9c1c6720cdb2166f3bdf10 | 18,301 | py | Python | numpy/core/tests/test_half.py | mspacek/numpy | 645b9f572f0a22e9049fd736b8b91427be2c8402 | [
"BSD-3-Clause"
] | null | null | null | numpy/core/tests/test_half.py | mspacek/numpy | 645b9f572f0a22e9049fd736b8b91427be2c8402 | [
"BSD-3-Clause"
] | null | null | null | numpy/core/tests/test_half.py | mspacek/numpy | 645b9f572f0a22e9049fd736b8b91427be2c8402 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import division, absolute_import, print_function
import platform
import numpy as np
from numpy import uint16, float16, float32, float64
from numpy.testing import TestCase, run_module_suite, assert_, assert_equal, \
dec
def assert_raises_fpe(strmatch, callable, *args, **kwargs):
try:
... | 41.593182 | 90 | 0.54926 |
17290d747359ba00ff8e98126d73fe5d234e36b1 | 9,690 | py | Python | SelectWindowSize/run_LogisticRegression.py | tufts-ml/fNIRS-mental-workload-classifiers | b5199d6184e659152d1fe650db48eba53a221186 | [
"MIT"
] | 4 | 2021-12-22T12:04:29.000Z | 2022-03-23T20:02:21.000Z | SelectWindowSize/run_LogisticRegression.py | tufts-ml/fNIRS-mental-workload-classifiers | b5199d6184e659152d1fe650db48eba53a221186 | [
"MIT"
] | null | null | null | SelectWindowSize/run_LogisticRegression.py | tufts-ml/fNIRS-mental-workload-classifiers | b5199d6184e659152d1fe650db48eba53a221186 | [
"MIT"
] | 4 | 2021-12-29T09:02:20.000Z | 2022-02-24T22:15:40.000Z | #NOTE: run this script with the bpf data, use 5050 paradigm
import os
import sys
import numpy as np
import argparse
from easydict import EasyDict as edict
from tqdm import trange
# from sklearn.model_selection import KFold
from sklearn.linear_model import LogisticRegression
YOUR_PATH = os.environ['YOUR_PATH']
sys.pa... | 41.234043 | 175 | 0.709804 |
e355efaf0f7227ed490abb3e81e3f509a8f91363 | 548 | py | Python | LeetCode/599_minimum_index_sum_of_two_lists/findRestaurant.py | harveyc95/ProgrammingProblems | d81dc58de0347fa155f5e25f27d3d426ce13cdc6 | [
"MIT"
] | null | null | null | LeetCode/599_minimum_index_sum_of_two_lists/findRestaurant.py | harveyc95/ProgrammingProblems | d81dc58de0347fa155f5e25f27d3d426ce13cdc6 | [
"MIT"
] | null | null | null | LeetCode/599_minimum_index_sum_of_two_lists/findRestaurant.py | harveyc95/ProgrammingProblems | d81dc58de0347fa155f5e25f27d3d426ce13cdc6 | [
"MIT"
] | null | null | null | class Solution(object):
def findRestaurant(self, list1, list2):
dict1 = {rest:idx for idx, rest in enumerate(list1)}
print dict1
ans = []
minSum = 3000
for idx, rest in enumerate(list2):
if rest in dict1:
curSum = dict1[rest] + idx
... | 30.444444 | 60 | 0.458029 |
1bcb58b6efe0786aacd88cf0134c4fef6bf14f19 | 4,809 | py | Python | gen.py | AgamChopra/Unsupervised-image2image-shape-deformation- | 36a600a016374d3d2a6e5b19053469b57c1faa06 | [
"MIT"
] | 1 | 2021-06-10T12:47:57.000Z | 2021-06-10T12:47:57.000Z | gen.py | AgamChopra/Unsupervised-image2image-shape-deformation | 36a600a016374d3d2a6e5b19053469b57c1faa06 | [
"MIT"
] | null | null | null | gen.py | AgamChopra/Unsupervised-image2image-shape-deformation | 36a600a016374d3d2a6e5b19053469b57c1faa06 | [
"MIT"
] | null | null | null | # generator
import torch.nn as nn
import torch
def E2L(ic,hc,oc,k,s):
out = nn.Sequential(nn.Conv2d(in_channels=ic, out_channels=hc, kernel_size=1, bias=False),
nn.BatchNorm2d(hc),nn.ReLU(),
nn.Conv2d(in_channels=hc, out_channels=oc, kernel_size=1, bias=Fals... | 38.166667 | 129 | 0.520898 |
069386d2c1467ed9047bd1898047a78ccb1652ee | 11,543 | py | Python | hydra/_internal/grammar/grammar_functions.py | evdcush/hydra | 5a34a01eaa0f0426d967e918a3ecd8ac6fcf9f47 | [
"MIT"
] | 1 | 2020-09-25T07:12:14.000Z | 2020-09-25T07:12:14.000Z | hydra/_internal/grammar/grammar_functions.py | evdcush/hydra | 5a34a01eaa0f0426d967e918a3ecd8ac6fcf9f47 | [
"MIT"
] | 7 | 2021-06-28T20:30:25.000Z | 2022-02-27T10:27:47.000Z | hydra/_internal/grammar/grammar_functions.py | evdcush/hydra | 5a34a01eaa0f0426d967e918a3ecd8ac6fcf9f47 | [
"MIT"
] | 1 | 2020-10-10T21:40:08.000Z | 2020-10-10T21:40:08.000Z | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
import builtins
import random
from copy import copy
from typing import Any, Callable, Dict, List, Optional, Union
from hydra._internal.grammar.utils import is_type_matching
from hydra.core.override_parser.types import (
ChoiceSweep,
Glob,
... | 32.424157 | 107 | 0.628 |
c48f4943f874b8dbbf6f1f4472318dff456de758 | 7,161 | py | Python | tri_loss/model/ShuffleNetV2.py | mbaharan/person-reid | 7caea3a1ab2c440c9a5e20a66633f2e3fcd065b5 | [
"BSD-3-Clause"
] | 12 | 2019-05-10T09:56:39.000Z | 2021-08-09T03:42:28.000Z | tri_loss/model/ShuffleNetV2.py | mbaharan/person-reid | 7caea3a1ab2c440c9a5e20a66633f2e3fcd065b5 | [
"BSD-3-Clause"
] | 1 | 2020-02-03T13:50:06.000Z | 2020-02-03T13:50:06.000Z | tri_loss/model/ShuffleNetV2.py | mbaharan/person-reid | 7caea3a1ab2c440c9a5e20a66633f2e3fcd065b5 | [
"BSD-3-Clause"
] | 8 | 2019-10-04T15:23:18.000Z | 2021-05-08T07:08:09.000Z | import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
from collections import OrderedDict
from torch.nn import init
import math
def conv_bn(inp, oup, stride):
return nn.Sequential(
nn.Conv2d(inp, oup, 3, stride, 1, bias=False),
nn.BatchNorm2d(oup),
... | 32.402715 | 118 | 0.557604 |
2690c7b93af744b56685883982d249f706bb6fff | 401 | py | Python | envdsys/envnet/migrations/0016_daqregistration_config2.py | NOAA-PMEL/envDataSystem | 4db4a3569d2329658799a3eef06ce36dd5c0597d | [
"Unlicense"
] | 1 | 2021-11-06T19:22:53.000Z | 2021-11-06T19:22:53.000Z | envdsys/envnet/migrations/0016_daqregistration_config2.py | NOAA-PMEL/envDataSystem | 4db4a3569d2329658799a3eef06ce36dd5c0597d | [
"Unlicense"
] | 25 | 2019-06-18T20:40:36.000Z | 2021-07-23T20:56:48.000Z | envdsys/envnet/migrations/0016_daqregistration_config2.py | NOAA-PMEL/envDataSystem | 4db4a3569d2329658799a3eef06ce36dd5c0597d | [
"Unlicense"
] | null | null | null | # Generated by Django 3.1.7 on 2021-04-14 23:38
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('envnet', '0015_auto_20210223_0034'),
]
operations = [
migrations.AddField(
model_name='daqregistration',
name='confi... | 21.105263 | 58 | 0.605985 |
56b7ff7a65f9cbd432cccaada4987e91b6859e51 | 1,099 | py | Python | Python/max-points-on-a-line.py | black-shadows/LeetCode-Solutions | b1692583f7b710943ffb19b392b8bf64845b5d7a | [
"Fair",
"Unlicense"
] | null | null | null | Python/max-points-on-a-line.py | black-shadows/LeetCode-Solutions | b1692583f7b710943ffb19b392b8bf64845b5d7a | [
"Fair",
"Unlicense"
] | null | null | null | Python/max-points-on-a-line.py | black-shadows/LeetCode-Solutions | b1692583f7b710943ffb19b392b8bf64845b5d7a | [
"Fair",
"Unlicense"
] | null | null | null | # Time: O(n^2)
# Space: O(n)
import collections
# Definition for a point
class Point(object):
def __init__(self, a=0, b=0):
self.x = a
self.y = b
class Solution(object):
def maxPoints(self, points):
"""
:type points: List[Point]
:rtype: int
"... | 27.475 | 76 | 0.464968 |
df23e41f51c16e0d0e0629178c103699ffbc36c1 | 7,525 | py | Python | deeplearning/overthinking_experiments.py | yuuu14/multi-exit-network | eabf7b23fe93e261a5350ed03075dcb49fdeb0f8 | [
"MIT"
] | null | null | null | deeplearning/overthinking_experiments.py | yuuu14/multi-exit-network | eabf7b23fe93e261a5350ed03075dcb49fdeb0f8 | [
"MIT"
] | null | null | null | deeplearning/overthinking_experiments.py | yuuu14/multi-exit-network | eabf7b23fe93e261a5350ed03075dcb49fdeb0f8 | [
"MIT"
] | null | null | null | # overthinking_experiments.py
# runs the experiments in section 4
# quantifies the wasteful and destructive effects
# produces the images to explain these effects
import torch
import torchvision.utils
import numpy as np
import pprint
import os
import time
from shutil import copyfile
from collections import Counter
f... | 37.625 | 136 | 0.689701 |
ff27c896686a2b0c4bf352e79868d6180f3f7ff2 | 6,993 | py | Python | src/htmlparser/fsm_config.py | greenius/ctemplate | 2c37d13940c555abb7eb9932a5ab428a99ff6db4 | [
"BSD-3-Clause"
] | 6 | 2016-01-27T18:01:52.000Z | 2019-09-10T02:27:09.000Z | src/htmlparser/fsm_config.py | greenius/ctemplate | 2c37d13940c555abb7eb9932a5ab428a99ff6db4 | [
"BSD-3-Clause"
] | 2 | 2019-01-14T01:35:28.000Z | 2019-02-03T08:32:51.000Z | src/htmlparser/fsm_config.py | greenius/ctemplate | 2c37d13940c555abb7eb9932a5ab428a99ff6db4 | [
"BSD-3-Clause"
] | 6 | 2016-10-27T22:32:28.000Z | 2019-09-03T16:56:35.000Z | #!/usr/bin/env python
#
# Copyright (c) 2008, Google Inc.
# 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 ... | 31.5 | 79 | 0.660518 |
6c339f4312de4a2a7b18527e4fb0f0a0591eef19 | 3,398 | py | Python | Validation/HGCalValidation/python/HGCalValidator_cfi.py | ryanm124/cmssw | 9c955a497467f8cc57a7cc1eefc39d41d2d3d89e | [
"Apache-2.0"
] | 13 | 2015-11-30T15:49:45.000Z | 2022-02-08T16:11:30.000Z | Validation/HGCalValidation/python/HGCalValidator_cfi.py | ryanm124/cmssw | 9c955a497467f8cc57a7cc1eefc39d41d2d3d89e | [
"Apache-2.0"
] | 640 | 2015-02-11T18:55:47.000Z | 2022-03-31T14:12:23.000Z | Validation/HGCalValidation/python/HGCalValidator_cfi.py | ryanm124/cmssw | 9c955a497467f8cc57a7cc1eefc39d41d2d3d89e | [
"Apache-2.0"
] | 51 | 2015-08-11T21:01:40.000Z | 2022-03-30T07:31:34.000Z | import FWCore.ParameterSet.Config as cms
from Validation.HGCalValidation.CaloParticleSelectionForEfficiency_cfi import *
from Validation.HGCalValidation.HGVHistoProducerAlgoBlock_cfi import *
from SimCalorimetry.HGCalAssociatorProducers.LCToCPAssociation_cfi import layerClusterCaloParticleAssociation
from SimCalorime... | 41.439024 | 109 | 0.791054 |
768b2b209ab18ecc8d925bdc2064b920145939fb | 2,833 | py | Python | inpaint/model/transformer/transformer_method.py | Janspiry/A-Demo-for-Image-Inpainting-by-React | e1951027d10677a1fd4463b05c7acf473481decb | [
"MIT"
] | 2 | 2021-12-07T03:13:32.000Z | 2021-12-26T04:44:40.000Z | inpaint/model/transformer/transformer_method.py | Janspiry/A-Demo-for-Image-Inpainting-by-React | e1951027d10677a1fd4463b05c7acf473481decb | [
"MIT"
] | null | null | null | inpaint/model/transformer/transformer_method.py | Janspiry/A-Demo-for-Image-Inpainting-by-React | e1951027d10677a1fd4463b05c7acf473481decb | [
"MIT"
] | null | null | null | from .transformer import TransformerLayer
from .transformer_withmask import TransformerLayer as Mask_TransformerLayer
from .swin_transformer import TransformerModule as Swin_TransformerLayer
import torch
import torch.nn as nn
class TransformerBlock(nn.Module):
def __init__(self, size, patch_size, MiniTransFormer=No... | 35.4125 | 98 | 0.622661 |
f413e834b4b1996e62cfc16774efbd53c949c33a | 10,696 | py | Python | scripts/NavPy/demo_c172.py | AuraUAS/aura-core | 4711521074db72ba9089213e14455d89dc5306c0 | [
"MIT",
"BSD-2-Clause-FreeBSD"
] | 8 | 2016-08-03T19:35:03.000Z | 2019-12-15T06:25:05.000Z | scripts/NavPy/demo_c172.py | jarilq/aura-core | 7880ed265396bf8c89b783835853328e6d7d1589 | [
"MIT",
"BSD-2-Clause-FreeBSD"
] | 4 | 2018-09-27T15:48:56.000Z | 2018-11-05T12:38:10.000Z | scripts/NavPy/demo_c172.py | jarilq/aura-core | 7880ed265396bf8c89b783835853328e6d7d1589 | [
"MIT",
"BSD-2-Clause-FreeBSD"
] | 5 | 2017-06-28T19:15:36.000Z | 2020-02-19T19:31:24.000Z | from loading_mat_data import load_struct
import numpy as np
import matplotlib.pyplot as plt
import insgps_quat_15state
import navpy
np.set_printoptions(precision=5,suppress=True)
plt.close()
# >>> UMN UAV Flight Data
#path = '/Users/adhika/Dropbox/python_code/SysID/data/'
#fname = 'ibis_flight05_doublets_2013_07_07_c... | 39.179487 | 107 | 0.675112 |
b885e1f7ce772d5955ccf0e19011312e902048d0 | 323 | py | Python | exercícios/EX_CursoEmVideo/ex018.py | jose-carlos-code/CursoEmvideo-python | 8c9b82db2c2b906f6d8f2359a680b9b3af25da43 | [
"MIT"
] | 1 | 2021-01-11T15:10:36.000Z | 2021-01-11T15:10:36.000Z | exercícios/EX_CursoEmVideo/ex018.py | jose-carlos-code/CursoEmvideo-python | 8c9b82db2c2b906f6d8f2359a680b9b3af25da43 | [
"MIT"
] | null | null | null | exercícios/EX_CursoEmVideo/ex018.py | jose-carlos-code/CursoEmvideo-python | 8c9b82db2c2b906f6d8f2359a680b9b3af25da43 | [
"MIT"
] | null | null | null | import math
numero = float(input('digite o valor de um ângulo: '))
s = math.sin(math.radians(numero))
c = math.cos(math.radians(numero))
t = math.tan(math.radians(numero))
print('o seno de {} é {:.2f}'.format(numero,s))
print('o cosseno de {} é {:.2f}'.format(numero,c))
print('a tangente de {} é {:.2f}'.format(numero,t... | 35.888889 | 54 | 0.662539 |
9f4e4a7f0e4441c49d34e3c5b1a7b4aaaa480985 | 67,420 | py | Python | node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings_test.py | firojkabir/lsg | ff8b5edc02b2d45f6bc602c7a2aa592706009345 | [
"MIT"
] | 8 | 2016-08-11T16:27:15.000Z | 2021-08-10T06:20:09.000Z | node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings_test.py | firojkabir/lsg | ff8b5edc02b2d45f6bc602c7a2aa592706009345 | [
"MIT"
] | 7 | 2020-03-10T07:47:34.000Z | 2022-02-12T00:20:30.000Z | node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings_test.py | firojkabir/lsg | ff8b5edc02b2d45f6bc602c7a2aa592706009345 | [
"MIT"
] | 6 | 2015-07-08T20:31:37.000Z | 2022-03-18T01:33:27.000Z | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Unit tests for the MSVSSettings.py file."""
import StringIO
import unittest
import gyp.MSVSSettings as MSVSSettings
class... | 45.431267 | 82 | 0.550326 |
57adad65a20cd05dbd5a77e40b362810ffe56527 | 1,432 | py | Python | README_demo.py | phy25/tweetpi | eec30a1ba861d5968b778d4f7056fb0b814bc699 | [
"MIT"
] | 2 | 2019-03-08T03:05:07.000Z | 2020-11-01T11:43:11.000Z | README_demo.py | phy25/tweetpi | eec30a1ba861d5968b778d4f7056fb0b814bc699 | [
"MIT"
] | 22 | 2018-09-10T21:14:17.000Z | 2018-12-01T06:51:12.000Z | README_demo.py | phy25/tweetpi | eec30a1ba861d5968b778d4f7056fb0b814bc699 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
from TweetPI import TweetPI, video
import sys
# Change keys below or in `options.json` before you execute!
# To read options from file, use
import json
with open("options.json", "r") as fp:
o = json.load(fp)
# To use the static options, use
# o = {"twitter_consumer_key":"...", "twitter_consume... | 38.702703 | 202 | 0.649441 |
793dab9a3babf8d8dea5f5191b9b3fa21911114e | 1,017 | py | Python | tests/experiment/dallinger_experiment.py | istresearch/Dallinger | 47e4967ded9e01edbc8c1ae7132c9ec30a87f116 | [
"MIT"
] | 1 | 2020-01-29T04:13:26.000Z | 2020-01-29T04:13:26.000Z | tests/experiment/dallinger_experiment.py | jcpeterson/Dallinger | 55bf00efddb19ab8b7201b65c461996793edf6f4 | [
"MIT"
] | null | null | null | tests/experiment/dallinger_experiment.py | jcpeterson/Dallinger | 55bf00efddb19ab8b7201b65c461996793edf6f4 | [
"MIT"
] | 1 | 2019-02-07T14:16:39.000Z | 2019-02-07T14:16:39.000Z | from dallinger.config import get_config
from dallinger.experiment import Experiment
config = get_config()
class TestExperiment(Experiment):
_completed = None
def __init__(self, session=None):
try:
super(TestExperiment, self).__init__(session)
except TypeError:
self.pr... | 24.214286 | 57 | 0.60177 |
c5d781b2233f761719779e98344d428a52bf4fe4 | 12,982 | py | Python | airbyte-integrations/connectors/source-amazon-ads/unit_tests/test_report_streams.py | harshithmullapudi/airbyte | c3c489ae3fc397580e598899bcc523cbaf4fdcd5 | [
"MIT"
] | null | null | null | airbyte-integrations/connectors/source-amazon-ads/unit_tests/test_report_streams.py | harshithmullapudi/airbyte | c3c489ae3fc397580e598899bcc523cbaf4fdcd5 | [
"MIT"
] | null | null | null | airbyte-integrations/connectors/source-amazon-ads/unit_tests/test_report_streams.py | harshithmullapudi/airbyte | c3c489ae3fc397580e598899bcc523cbaf4fdcd5 | [
"MIT"
] | null | null | null | #
# MIT License
#
# Copyright (c) 2020 Airbyte
#
# 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 the rights
# to use, copy, modify, merge, pu... | 39.944615 | 297 | 0.730627 |
862a27ccede05995dccd4603adc9ef1f9b209922 | 461 | py | Python | plotly/validators/area/stream/_token.py | faezs/plotly.py | 6009b5b9c746e5d2a2849ad255a4eb234b551ed7 | [
"MIT"
] | 2 | 2020-03-24T11:41:14.000Z | 2021-01-14T07:59:43.000Z | plotly/validators/area/stream/_token.py | faezs/plotly.py | 6009b5b9c746e5d2a2849ad255a4eb234b551ed7 | [
"MIT"
] | null | null | null | plotly/validators/area/stream/_token.py | faezs/plotly.py | 6009b5b9c746e5d2a2849ad255a4eb234b551ed7 | [
"MIT"
] | 4 | 2019-06-03T14:49:12.000Z | 2022-01-06T01:05:12.000Z | import _plotly_utils.basevalidators
class TokenValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(
self, plotly_name='token', parent_name='area.stream', **kwargs
):
super(TokenValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_nam... | 25.611111 | 70 | 0.598698 |
691187d1932a01ee94d3532bbdeb85d968756173 | 1,632 | py | Python | gs/content/favicon/tests/icon.py | groupserver/gs.content.favicon | 9b54d44c1c14e82fce77ff2303ade8f3ea500555 | [
"ZPL-2.1"
] | null | null | null | gs/content/favicon/tests/icon.py | groupserver/gs.content.favicon | 9b54d44c1c14e82fce77ff2303ade8f3ea500555 | [
"ZPL-2.1"
] | null | null | null | gs/content/favicon/tests/icon.py | groupserver/gs.content.favicon | 9b54d44c1c14e82fce77ff2303ade8f3ea500555 | [
"ZPL-2.1"
] | null | null | null | # -*- coding: utf-8 -*-
############################################################################
#
# Copyright © 2016 OnlineGroups.net and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this dis... | 37.090909 | 94 | 0.64277 |
75af9ddf9ca18b38bc3b878d52c0d4ee02cb1b6b | 4,174 | py | Python | final/one_time/emotion.py | Fabhi/sentiment-analysis | addf82c40ef1999241edbc80df164db908d56b57 | [
"MIT"
] | 1 | 2021-05-22T18:48:14.000Z | 2021-05-22T18:48:14.000Z | final/one_time/emotion.py | Fabhi/sentiment-analysis | addf82c40ef1999241edbc80df164db908d56b57 | [
"MIT"
] | null | null | null | final/one_time/emotion.py | Fabhi/sentiment-analysis | addf82c40ef1999241edbc80df164db908d56b57 | [
"MIT"
] | null | null | null | import re
from emotion_dict import getEmotionDict
patterns = []
adverbs = frozenset(["not", "also", "very", "often", "however", "too", "usually", "really", "early", "never", "always", "sometimes", "together", "likely", "simply", "generally", "instead", "actually", "again", "rather", "almost", "especially", "ever", "qui... | 54.207792 | 1,407 | 0.614998 |
a0bc6d2d2750a6e3cd59d8a87c260f794c0a6eb8 | 1,162 | py | Python | src/probnum/linalg/solvers/policies/_linear_solver_policy.py | treid5/probnum | fabb51243d0952fbd35e542aeb5c2dc9a449ec81 | [
"MIT"
] | 1 | 2021-06-22T14:25:43.000Z | 2021-06-22T14:25:43.000Z | src/probnum/linalg/solvers/policies/_linear_solver_policy.py | pitmonticone/probnum | 1fed705b2443a14d08419e16f98f6ef815ae9ffa | [
"MIT"
] | 42 | 2021-03-08T07:20:40.000Z | 2022-03-28T05:04:48.000Z | src/probnum/linalg/solvers/policies/_linear_solver_policy.py | pitmonticone/probnum | 1fed705b2443a14d08419e16f98f6ef815ae9ffa | [
"MIT"
] | null | null | null | """Base class for policies of probabilistic linear solvers returning actions."""
import abc
import numpy as np
import probnum # pylint: disable="unused-import"
class LinearSolverPolicy(abc.ABC):
r"""Policy of a (probabilistic) linear solver.
The policy :math:`\pi(s \mid \mathsf{A}, \mathsf{H}, \mathsf{x},... | 29.05 | 88 | 0.657487 |
4d0cde26455d1e37160c3381aedeaa565118f545 | 7,448 | py | Python | src/semantic_parsing_with_constrained_lm/domains/calflow/disambiguate.py | microsoft/semantic_parsing_with_constrained_lm | 7e3c099500c3102e46d7a47469fe6840580c2b11 | [
"MIT"
] | 17 | 2021-09-22T13:08:37.000Z | 2022-03-27T10:39:53.000Z | src/semantic_parsing_with_constrained_lm/domains/calflow/disambiguate.py | microsoft/semantic_parsing_with_constrained_lm | 7e3c099500c3102e46d7a47469fe6840580c2b11 | [
"MIT"
] | 1 | 2022-03-12T01:05:15.000Z | 2022-03-12T01:05:15.000Z | src/semantic_parsing_with_constrained_lm/domains/calflow/disambiguate.py | microsoft/semantic_parsing_with_constrained_lm | 7e3c099500c3102e46d7a47469fe6840580c2b11 | [
"MIT"
] | 1 | 2021-12-16T22:26:54.000Z | 2021-12-16T22:26:54.000Z | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
import re
from dataflow.core.lispress import Lispress, parse_lispress
from semantic_parsing_with_constrained_lm.util.util import flatten
def no_alwaystrue_under_getintrasalient(f: Lispress):
"""
GetIntraSalient should always be called... | 32.810573 | 107 | 0.643126 |
4f5f8f6aae0cab1090fa7950389ac644657ad7d9 | 4,789 | py | Python | python/cugraph/link_analysis/pagerank.py | cfld/cugraph | 085922880478779597aa0c4c7e0a117e3e4a7515 | [
"Apache-2.0"
] | null | null | null | python/cugraph/link_analysis/pagerank.py | cfld/cugraph | 085922880478779597aa0c4c7e0a117e3e4a7515 | [
"Apache-2.0"
] | null | null | null | python/cugraph/link_analysis/pagerank.py | cfld/cugraph | 085922880478779597aa0c4c7e0a117e3e4a7515 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2019-2021, NVIDIA CORPORATION.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed... | 39.578512 | 79 | 0.676968 |
1ef324ffe446d4d75c22c3fe84319cf3ee9bff77 | 946 | py | Python | Exercicios/semaforo.py | beatrizflorenccio/Projects-Python | fc584167a2816dc89f22baef0fa0f780af796c98 | [
"MIT"
] | 1 | 2021-10-10T08:18:45.000Z | 2021-10-10T08:18:45.000Z | Exercicios/semaforo.py | beatrizflorenccio/Projects-Python | fc584167a2816dc89f22baef0fa0f780af796c98 | [
"MIT"
] | null | null | null | Exercicios/semaforo.py | beatrizflorenccio/Projects-Python | fc584167a2816dc89f22baef0fa0f780af796c98 | [
"MIT"
] | null | null | null | #MaBe
import time
print()
print("=" * 30)
print("\33[1;38;48mSEMÁFORO\33[m".center(43))
print("=" * 30)
t1 = int(input("Tempo para o vermelho: "))
t2 = int(input("Tempo para o amarelo: "))
t3 = int(input("Tempo para o verde: "))
print()
print("INICIANDO SISTEMA...")
time.sleep(1)
#Vermelho
print()
print("\33[1; 31m... | 21.022222 | 45 | 0.630021 |
07099b8c34ca13c1e41008c4abc2e12fdb4bcd16 | 6,134 | py | Python | optimization.py | baobaozhou/BertClassfiy | 5c994636ee63164752515a082c8d8a373bea3dcd | [
"Apache-2.0"
] | null | null | null | optimization.py | baobaozhou/BertClassfiy | 5c994636ee63164752515a082c8d8a373bea3dcd | [
"Apache-2.0"
] | null | null | null | optimization.py | baobaozhou/BertClassfiy | 5c994636ee63164752515a082c8d8a373bea3dcd | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2018 The Google AI Language Team Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... | 35.662791 | 80 | 0.687154 |
fc0244284b072d9d6466a98f1e2a45171b2b44b8 | 12,174 | py | Python | test/test_dataset.py | joannetruong/habitat-api | aad2fd7b8545dce44daefd4b7b3941672eb96ee3 | [
"MIT"
] | 355 | 2020-08-18T03:48:26.000Z | 2022-03-30T00:22:50.000Z | test/test_dataset.py | joannetruong/habitat-api | aad2fd7b8545dce44daefd4b7b3941672eb96ee3 | [
"MIT"
] | 328 | 2020-08-12T21:25:09.000Z | 2022-03-31T10:39:21.000Z | test/test_dataset.py | joannetruong/habitat-api | aad2fd7b8545dce44daefd4b7b3941672eb96ee3 | [
"MIT"
] | 159 | 2020-08-12T22:23:36.000Z | 2022-03-30T22:56:52.000Z | #!/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.
from itertools import groupby, islice
import pytest
from habitat.core.dataset import Dataset, Episode
def _construct... | 33.629834 | 79 | 0.675867 |
397da19920522c12b705ddfdc6138bb6663582a4 | 1,008 | py | Python | authors/apps/profiles/renderers.py | ronaldndirangu/medium-clone | 0a65cf923cb340936e4e249fcf39ec2561b64ac9 | [
"BSD-3-Clause"
] | 3 | 2021-01-03T19:54:48.000Z | 2022-01-20T20:44:04.000Z | authors/apps/profiles/renderers.py | andela/ah-titans | 0a65cf923cb340936e4e249fcf39ec2561b64ac9 | [
"BSD-3-Clause"
] | 43 | 2018-07-23T12:34:09.000Z | 2021-06-10T20:34:54.000Z | authors/apps/profiles/renderers.py | ronaldndirangu/medium-clone | 0a65cf923cb340936e4e249fcf39ec2561b64ac9 | [
"BSD-3-Clause"
] | 3 | 2021-02-07T11:55:06.000Z | 2021-10-31T17:37:04.000Z | import json
from rest_framework.renderers import JSONRenderer
class ProfileJSONRenderer(JSONRenderer):
"""This class contains json renderer for Profile"""
charset = 'utf-8'
def render(self, data, media_type=None, renderer_context=None):
if data is not None:
if len(data) <= 1:
... | 24.585366 | 67 | 0.599206 |
07a4d49263ad580baa537b828be60a8e13d150c2 | 1,227 | py | Python | core/builder.py | spyrozone/keylogger | 7aa0bbccfa059db57bbb77a566ae69bdb768def3 | [
"BSD-3-Clause"
] | 235 | 2018-07-13T20:17:39.000Z | 2022-03-29T05:36:24.000Z | core/builder.py | safithetechi/HeraKeylogger | 7aa0bbccfa059db57bbb77a566ae69bdb768def3 | [
"BSD-3-Clause"
] | 5 | 2019-02-25T15:10:48.000Z | 2021-06-11T03:49:49.000Z | core/builder.py | safithetechi/HeraKeylogger | 7aa0bbccfa059db57bbb77a566ae69bdb768def3 | [
"BSD-3-Clause"
] | 90 | 2018-07-13T22:39:15.000Z | 2021-12-15T11:45:22.000Z | ######################################################
# #
# HeraChromeKeylogger #
# #
# by: UNDEADSEC #
# ... | 36.088235 | 74 | 0.393643 |
795dd2f2220171d65b48466f851ead2abe1ac163 | 929 | py | Python | oscar/lib/python2.7/site-packages/phonenumber_field/formfields.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | oscar/lib/python2.7/site-packages/phonenumber_field/formfields.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | oscar/lib/python2.7/site-packages/phonenumber_field/formfields.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.core.exceptions import ValidationError
from django.forms.fields import CharField
from django.utils.translation import ugettext_lazy as _
from phonenumber_field.phonenumber import to_python
from phonenumber_field.validators import va... | 33.178571 | 76 | 0.719053 |
5e3c0926e4dc855e63c9c044093af096314fc852 | 32 | py | Python | pyhwtherm/__init__.py | jlim0930/pyhwtherm | 8996d3847389aa03ae22795df2ee1ac612ae95c1 | [
"MIT"
] | 7 | 2015-03-11T04:28:00.000Z | 2021-09-10T19:05:24.000Z | pyhwtherm/__init__.py | jlim0930/pyhwtherm | 8996d3847389aa03ae22795df2ee1ac612ae95c1 | [
"MIT"
] | 1 | 2015-11-12T05:13:58.000Z | 2015-11-12T05:13:58.000Z | pyhwtherm/__init__.py | jlim0930/pyhwtherm | 8996d3847389aa03ae22795df2ee1ac612ae95c1 | [
"MIT"
] | 9 | 2015-07-08T13:01:33.000Z | 2021-10-06T06:00:05.000Z | from pyhwtherm import PyHWTherm
| 16 | 31 | 0.875 |
3f5f5942ce364a3a55fcb56d742874accf450811 | 3,610 | py | Python | missioncontrol/v0/time.py | Psykar/missioncontrol | ca3a1ef523e04d87722ed18f4668c0a68bb3d519 | [
"Apache-2.0"
] | null | null | null | missioncontrol/v0/time.py | Psykar/missioncontrol | ca3a1ef523e04d87722ed18f4668c0a68bb3d519 | [
"Apache-2.0"
] | 1 | 2019-03-19T06:05:21.000Z | 2019-03-19T06:05:21.000Z | missioncontrol/v0/time.py | Psykar/missioncontrol | ca3a1ef523e04d87722ed18f4668c0a68bb3d519 | [
"Apache-2.0"
] | null | null | null | from astropy.time import Time
from datetime import datetime
from django.conf import settings
from skyfield.api import Loader
load = Loader(settings.EPHEM_DIR)
TWO_DAYS_S = 2 * 24 * 60 * 60
def timescale_functions():
""" skyfield requires a "timescale" object that is used for things like
leap seconds. we... | 31.12069 | 83 | 0.625208 |
53a21ef11e468f4237d472511e30f3da466db47f | 1,714 | py | Python | test/base/test_resume_run.py | Gabriel-p/pyABC | a1c963203c9f9e3fa40793ccf214753fb689d27f | [
"BSD-3-Clause"
] | null | null | null | test/base/test_resume_run.py | Gabriel-p/pyABC | a1c963203c9f9e3fa40793ccf214753fb689d27f | [
"BSD-3-Clause"
] | null | null | null | test/base/test_resume_run.py | Gabriel-p/pyABC | a1c963203c9f9e3fa40793ccf214753fb689d27f | [
"BSD-3-Clause"
] | null | null | null | import numpy as np
import pytest
from pyabc import (
ABCSMC,
RV,
Distribution,
MulticoreEvalParallelSampler,
RedisEvalParallelSamplerServerStarter,
)
@pytest.fixture(params=[0, None])
def gt_model(request):
return request.param
def RedisEvalParallelSamplerLookAheadDelayWrapper(**kwargs):
... | 25.58209 | 77 | 0.679113 |
8fe97ff536ac2aed46c59c2b040ac53b442be9c8 | 2,928 | py | Python | shippo/test/test_address.py | penguinstampede/shippo-python-client | d21366d959d22ff301947072346479c287bf0f51 | [
"MIT"
] | 101 | 2015-10-10T18:44:36.000Z | 2022-01-26T03:54:27.000Z | shippo/test/test_address.py | penguinstampede/shippo-python-client | d21366d959d22ff301947072346479c287bf0f51 | [
"MIT"
] | 47 | 2015-08-07T21:13:50.000Z | 2022-03-08T18:48:16.000Z | shippo/test/test_address.py | penguinstampede/shippo-python-client | d21366d959d22ff301947072346479c287bf0f51 | [
"MIT"
] | 71 | 2015-10-31T01:54:09.000Z | 2022-02-17T22:43:30.000Z | # -*- coding: utf-8 -*-
import unittest2
from mock import patch
import shippo
from shippo.test.helper import (
DUMMY_ADDRESS,
INVALID_ADDRESS,
NOT_POSSIBLE_ADDRESS,
ShippoTestCase,
)
from shippo.test.helper import shippo_vcr
class AddressTests(ShippoTestCase):
request_client = shippo.http_clien... | 34.447059 | 81 | 0.717896 |
d2c4e929b183b82e88ba9a42870222ee184e0256 | 542 | py | Python | blender/arm/logicnode/physics/LN_set_rb_friction.py | notwarp/armory | bd6078e3035eefcb3c725664698eeb369b4c2d88 | [
"Zlib"
] | null | null | null | blender/arm/logicnode/physics/LN_set_rb_friction.py | notwarp/armory | bd6078e3035eefcb3c725664698eeb369b4c2d88 | [
"Zlib"
] | null | null | null | blender/arm/logicnode/physics/LN_set_rb_friction.py | notwarp/armory | bd6078e3035eefcb3c725664698eeb369b4c2d88 | [
"Zlib"
] | null | null | null | from arm.logicnode.arm_nodes import *
class SetFrictionNode (ArmLogicTreeNode):
"""Sets the friction of the given rigid body."""
bl_idname = 'LNSetFrictionNode'
bl_label = 'Set RB Friction'
bl_icon = 'NONE'
arm_version = 1
def init(self, context):
super(SetFrictionNode, self).init(cont... | 31.882353 | 54 | 0.671587 |
de30525f213036d4da51a3ab29938491e6bf5d71 | 15,649 | py | Python | dfc/networks/dfc_layer.py | mariacer/strong_dfc | 04d0c633106d39637867062c039583a022af374b | [
"Apache-2.0"
] | null | null | null | dfc/networks/dfc_layer.py | mariacer/strong_dfc | 04d0c633106d39637867062c039583a022af374b | [
"Apache-2.0"
] | null | null | null | dfc/networks/dfc_layer.py | mariacer/strong_dfc | 04d0c633106d39637867062c039583a022af374b | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# Copyright 2021 Alexander Meulemans, Matilde Tristany, Maria Cervera
#
# 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
... | 42.873973 | 80 | 0.629305 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.