hexsha stringlengths 40 40 | size int64 1 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 239 | max_stars_repo_name stringlengths 5 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 3 239 | max_issues_repo_name stringlengths 5 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 3 239 | max_forks_repo_name stringlengths 5 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 1 1.03M | avg_line_length float64 1 958k | max_line_length int64 1 1.03M | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4a0942c6dbf6d2ab8171f74a73f13b5a5dbf5ebd | 2,804 | py | Python | symreg/tree.py | fabiochiusano/SymbolicRegressionPy | ed2e4d6c56b6aa22ba9be02bc45a3ea7bedc7bfd | [
"MIT"
] | 1 | 2017-09-01T19:02:25.000Z | 2017-09-01T19:02:25.000Z | symreg/tree.py | fabiochiusano/SymbolicRegressionPy | ed2e4d6c56b6aa22ba9be02bc45a3ea7bedc7bfd | [
"MIT"
] | 1 | 2019-01-09T22:44:07.000Z | 2019-01-09T22:44:07.000Z | symreg/tree.py | fabiochiusano/SymbolicRegressionPy | ed2e4d6c56b6aa22ba9be02bc45a3ea7bedc7bfd | [
"MIT"
] | null | null | null | import math
import generator as gtr
class Tree(object):
def __init__(self):
pass
class Leaf(Tree):
def __init__(self):
pass
def height(self):
""" The height of a leaf is always 1 """
return 1
def numOfNodes(self):
""" Returns the number of nodes, both internal
and leaves, of the subtree with this ... | 26.961538 | 96 | 0.702211 |
4a0945657e38330951d46bb7605c031d008f3eec | 642 | py | Python | ircbot/plugin/thanks.py | encadyma/ircbot | e8ef7b091accf6337b313838ea6c41cd20148a11 | [
"Apache-2.0",
"CC-BY-4.0"
] | null | null | null | ircbot/plugin/thanks.py | encadyma/ircbot | e8ef7b091accf6337b313838ea6c41cd20148a11 | [
"Apache-2.0",
"CC-BY-4.0"
] | null | null | null | ircbot/plugin/thanks.py | encadyma/ircbot | e8ef7b091accf6337b313838ea6c41cd20148a11 | [
"Apache-2.0",
"CC-BY-4.0"
] | null | null | null | """Show your appreciation."""
import random
def register(bot):
bot.listen(r'^thanks', thanks, require_mention=True)
bot.listen(r'thanks,? create', thanks)
bot.listen(r'^thank (.*)$', thank_someone, require_mention=True)
def thanks(bot, msg):
"""Thank create for being a helpful robot."""
msg.resp... | 24.692308 | 69 | 0.595016 |
4a09461498b7e069dfcde3e2e918e4ad1ed0d36d | 178 | py | Python | backend/waqur/models.py | crowdbotics-apps/tstec20211223-32572 | 47487c035162e2fdffc1ed3c6bf7d84baf06e0ba | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/waqur/models.py | crowdbotics-apps/tstec20211223-32572 | 47487c035162e2fdffc1ed3c6bf7d84baf06e0ba | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/waqur/models.py | crowdbotics-apps/tstec20211223-32572 | 47487c035162e2fdffc1ed3c6bf7d84baf06e0ba | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | from django.conf import settings
from django.db import models
class Test123(models.Model):
"Generated Model"
lastName = models.TextField()
# Create your models here.
| 16.181818 | 33 | 0.741573 |
4a094719e0333960e614e1eb1baf297ada59d2d6 | 1,758 | py | Python | mod/distributorapi/setup.py | onap/dcaegen2-platform | 9e930892d28fc4a3378fad8f942c9f91cffe4698 | [
"Apache-2.0",
"CC-BY-4.0"
] | null | null | null | mod/distributorapi/setup.py | onap/dcaegen2-platform | 9e930892d28fc4a3378fad8f942c9f91cffe4698 | [
"Apache-2.0",
"CC-BY-4.0"
] | null | null | null | mod/distributorapi/setup.py | onap/dcaegen2-platform | 9e930892d28fc4a3378fad8f942c9f91cffe4698 | [
"Apache-2.0",
"CC-BY-4.0"
] | 1 | 2021-10-15T15:02:20.000Z | 2021-10-15T15:02:20.000Z | # ============LICENSE_START=======================================================
# Copyright (c) 2019 AT&T Intellectual Property. All rights reserved.
# ================================================================================
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use ... | 39.954545 | 92 | 0.596132 |
4a0947d736afc849b46fa9a43ed8a8dcf21d36a5 | 832 | py | Python | agent/ACconnector/connect_module/Controller_module/interface_module.py | Over42M/Fun5Ga | 7712fcae3968a80c3f7957457e5f0492fbd1f812 | [
"Apache-2.0"
] | 7 | 2017-04-26T12:28:22.000Z | 2021-02-09T18:59:50.000Z | agent/ACconnector/connect_module/Controller_module/interface_module.py | Over42M/Fun5Ga | 7712fcae3968a80c3f7957457e5f0492fbd1f812 | [
"Apache-2.0"
] | 1 | 2017-04-26T15:22:51.000Z | 2017-04-28T04:41:51.000Z | agent/ACconnector/connect_module/Controller_module/interface_module.py | Over42M/Fun5Ga | 7712fcae3968a80c3f7957457e5f0492fbd1f812 | [
"Apache-2.0"
] | 8 | 2017-06-01T08:42:16.000Z | 2020-07-23T12:30:19.000Z | # -*- coding: utf-8 -*-
import socket
import fcntl
import struct
import array
def all_interfaces():
max_possible = 128 # arbitrary. raise if needed.
bytes = max_possible * 32
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
names = array.array('B', '\0' * bytes)
outbytes = struct.unpack('iL'... | 25.212121 | 56 | 0.549279 |
4a0948e608e8642f010114534c45724554bbdbbf | 3,345 | py | Python | LSTM_Text_Generation/Analyse/Word_BestI_MaxAlg.py | naykun/MusicResearch | 97bd64f23710c9f45634da0fd4674172746cfaf5 | [
"Apache-2.0"
] | 5 | 2018-07-11T02:39:40.000Z | 2020-09-07T19:26:46.000Z | LSTM_Text_Generation/Analyse/Word_BestI_MaxAlg.py | naykun/MusicResearch | 97bd64f23710c9f45634da0fd4674172746cfaf5 | [
"Apache-2.0"
] | null | null | null | LSTM_Text_Generation/Analyse/Word_BestI_MaxAlg.py | naykun/MusicResearch | 97bd64f23710c9f45634da0fd4674172746cfaf5 | [
"Apache-2.0"
] | 2 | 2018-07-11T13:36:19.000Z | 2018-09-01T03:42:04.000Z | from nltk.tokenize import WordPunctTokenizer
import io
import numpy as np
def wordtokenizer(sentence):
# 分段
words = WordPunctTokenizer().tokenize(sentence)
return words
# path = '/unsullied/sharefs/ouyangzhihao/isilon-home/AAAI/mos/data/penn/train.txt'
# with io.open(path, encoding='utf-8') as f:
# te... | 28.589744 | 85 | 0.632885 |
4a09493e54a9c2ff51036aabcb4d38acbada0654 | 246 | py | Python | tests/test_health.py | Divyanshu1509/covid-api | 21d53344be723b4e4b4cdd9476c3cb088e61aeb6 | [
"MIT"
] | null | null | null | tests/test_health.py | Divyanshu1509/covid-api | 21d53344be723b4e4b4cdd9476c3cb088e61aeb6 | [
"MIT"
] | null | null | null | tests/test_health.py | Divyanshu1509/covid-api | 21d53344be723b4e4b4cdd9476c3cb088e61aeb6 | [
"MIT"
] | null | null | null | from fastapi.testclient import TestClient
from covidapi.app import app
client = TestClient(app)
def test_health():
response = client.get("/v1/health/")
assert response.status_code == 300
assert response.json() == {"status": "OK"}
| 20.5 | 46 | 0.703252 |
4a0949cc9b5a46ee27de7d382b8b300e27b428d5 | 12,826 | py | Python | capsnet/mnist.py | zyg1968/learn | a0b3c01b6e338ad53d5ba52da6b1be07da4bf324 | [
"BSD-2-Clause"
] | null | null | null | capsnet/mnist.py | zyg1968/learn | a0b3c01b6e338ad53d5ba52da6b1be07da4bf324 | [
"BSD-2-Clause"
] | null | null | null | capsnet/mnist.py | zyg1968/learn | a0b3c01b6e338ad53d5ba52da6b1be07da4bf324 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import struct, os, sys, random
import math
import time
import threading
from tkinter import *
from PIL import Image, ImageTk
import queue
from scrolledwindow import ScrolledWindow
import tensorflow as tf
import numpy as np
import capsnet
from tqdm import tqdm
import confi... | 39.58642 | 163 | 0.567909 |
4a094a75528def8ab9ed480fef026a80f95005bd | 1,632 | py | Python | Backtracking/subset_sum.py | pritsheth/Algorithms-Python | b8af30cbf95a772c9b9b997a30ff2c8b56a040e0 | [
"MIT"
] | null | null | null | Backtracking/subset_sum.py | pritsheth/Algorithms-Python | b8af30cbf95a772c9b9b997a30ff2c8b56a040e0 | [
"MIT"
] | null | null | null | Backtracking/subset_sum.py | pritsheth/Algorithms-Python | b8af30cbf95a772c9b9b997a30ff2c8b56a040e0 | [
"MIT"
] | null | null | null | # For example, given candidate set [2, 3, 6, 7] and target 7,
# A solution set is:
# [
# [7],
# [2, 2, 3]
# ]
class Solution(object):
def backtrack(self, result, nums, cur, path, start_index):
if cur < 0:
return None
if cur == 0:
result.append(path[:])
re... | 22.666667 | 74 | 0.520833 |
4a094a8a677fc5b0e26c9d6fe1010d762d53d2f4 | 7,614 | py | Python | kfac.py | sumitsk/pytorch-a2c-ppo-acktr | 98c5a20eadf0e453d545bc7c333366824f379efd | [
"MIT"
] | 9 | 2018-10-17T21:27:52.000Z | 2021-11-03T15:36:56.000Z | kfac.py | sumitsk/pytorch-a2c-ppo-acktr | 98c5a20eadf0e453d545bc7c333366824f379efd | [
"MIT"
] | 6 | 2021-03-18T21:24:56.000Z | 2022-03-11T23:34:25.000Z | kfac.py | sumitsk/pytorch-a2c-ppo-acktr | 98c5a20eadf0e453d545bc7c333366824f379efd | [
"MIT"
] | 10 | 2017-11-30T19:52:33.000Z | 2021-02-26T06:35:43.000Z | import math
import torch
import torch.optim as optim
import torch.nn as nn
import torch.nn.functional as F
from utils import AddBias
# TODO: In order to make this code faster:
# 1) Implement _extract_patches as a single cuda kernel
# 2) Compute QR decomposition in a separate process
# 3) Actually make a general KFAC ... | 31.725 | 95 | 0.532046 |
4a094be60922690a47540904a91e732d43e681dc | 95 | py | Python | manager/reactfront/apps.py | samihonk/djangorest | c64d3645fb34144ebf500f27e4e44f19d9cd0ca2 | [
"MIT"
] | null | null | null | manager/reactfront/apps.py | samihonk/djangorest | c64d3645fb34144ebf500f27e4e44f19d9cd0ca2 | [
"MIT"
] | 11 | 2020-10-12T14:07:07.000Z | 2022-02-26T22:21:36.000Z | manager/reactfront/apps.py | samihonk/djangorest | c64d3645fb34144ebf500f27e4e44f19d9cd0ca2 | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class ReactfrontConfig(AppConfig):
name = 'reactfront'
| 15.833333 | 34 | 0.768421 |
4a094bf4d6a1ec48084cd0e15efc7e7ddf26de35 | 7,907 | py | Python | lib/exporter/postprocessing.py | SimeonZhang/detectron2_tensorflow | ca03f633111d540ea91b3de75dbfa1da813647be | [
"Apache-2.0"
] | 3 | 2021-06-07T10:48:51.000Z | 2022-03-01T11:43:40.000Z | lib/exporter/postprocessing.py | SimeonZhang/detectron2_tensorflow | ca03f633111d540ea91b3de75dbfa1da813647be | [
"Apache-2.0"
] | null | null | null | lib/exporter/postprocessing.py | SimeonZhang/detectron2_tensorflow | ca03f633111d540ea91b3de75dbfa1da813647be | [
"Apache-2.0"
] | null | null | null | import tensorflow as tf
from ..layers import resize_images
from ..data import fields
from ..structures import box_list
from ..structures import box_list_ops
from ..utils import id_utils
def detector_postprocess(
results,
input_shape,
thing_class_names,
label_offset=1
):
"""
Normalize the boxe... | 39.143564 | 116 | 0.703427 |
4a094c1d7b7aa87a80ab10ea8aa5d74b1952896e | 2,937 | py | Python | sisyphus/python/status_pb2.py | AnsgarSchmidt/antikeimena | 8a8557de483c981b73195d62e4693d8c22d6ea68 | [
"Apache-2.0"
] | null | null | null | sisyphus/python/status_pb2.py | AnsgarSchmidt/antikeimena | 8a8557de483c981b73195d62e4693d8c22d6ea68 | [
"Apache-2.0"
] | null | null | null | sisyphus/python/status_pb2.py | AnsgarSchmidt/antikeimena | 8a8557de483c981b73195d62e4693d8c22d6ea68 | [
"Apache-2.0"
] | null | null | null | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: status.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflec... | 32.274725 | 244 | 0.738168 |
4a094f1ea1f9238d1f438fd71170ee8b3a03a43a | 7,591 | py | Python | ants/tests/EC.py | luv-sic/composing-programs | 27391ac844df045b865524f1936682a0872569b5 | [
"MIT"
] | 1 | 2021-11-27T08:53:01.000Z | 2021-11-27T08:53:01.000Z | ants/tests/EC.py | luvsic3/composing-programs | 27391ac844df045b865524f1936682a0872569b5 | [
"MIT"
] | null | null | null | ants/tests/EC.py | luvsic3/composing-programs | 27391ac844df045b865524f1936682a0872569b5 | [
"MIT"
] | null | null | null | test = {
'name': 'Problem EC',
'points': 2,
'suites': [
{
'cases': [
{
'code': r"""
>>> # Testing status parameters
>>> slow = SlowThrower()
>>> scary = ScaryThrower()
>>> SlowThrower.food_cost
c9452203eb0b0f0bd2454586a6c2fc5c
... | 29.885827 | 77 | 0.457779 |
4a094f5f2e36ff2a525403ca285885d04e07c029 | 4,410 | py | Python | qiskit/aqua/utils/measurement_error_mitigation.py | IanJoel/qiskit-aqua | 7707172d01f0539358f1ce2406f307e830105303 | [
"Apache-2.0"
] | null | null | null | qiskit/aqua/utils/measurement_error_mitigation.py | IanJoel/qiskit-aqua | 7707172d01f0539358f1ce2406f307e830105303 | [
"Apache-2.0"
] | null | null | null | qiskit/aqua/utils/measurement_error_mitigation.py | IanJoel/qiskit-aqua | 7707172d01f0539358f1ce2406f307e830105303 | [
"Apache-2.0"
] | 2 | 2020-02-13T02:17:58.000Z | 2020-08-09T07:56:25.000Z | # -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2019.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modif... | 34.453125 | 90 | 0.647392 |
4a094f9b372520025ed51db7f84e4d063c562218 | 778 | py | Python | post/models.py | LordK1/TesterSite | 83b3f55d66dcd8c7baf577a7c6cfbe58b1835408 | [
"MIT"
] | null | null | null | post/models.py | LordK1/TesterSite | 83b3f55d66dcd8c7baf577a7c6cfbe58b1835408 | [
"MIT"
] | null | null | null | post/models.py | LordK1/TesterSite | 83b3f55d66dcd8c7baf577a7c6cfbe58b1835408 | [
"MIT"
] | null | null | null | from django.db import models
# Create your models here.
class Category(models.Model):
title = models.CharField(max_length=100, null=False, blank=False)
created_date = models.DateTimeField(auto_now_add=True)
class Meta:
verbose_name = "Category"
verbose_name_plural = "Categories"
def ... | 26.827586 | 69 | 0.70437 |
4a09506aa8f1ea05fc74096df6ae18775869a1c9 | 3,756 | py | Python | HiC_count_bin_linkages_singleChr_diagonal_v1a.py | elifesciences-publications/Stadlerlab-hi-c | 95e304bf8cb2cd606f52f94bb6369fef4f16f73a | [
"MIT"
] | null | null | null | HiC_count_bin_linkages_singleChr_diagonal_v1a.py | elifesciences-publications/Stadlerlab-hi-c | 95e304bf8cb2cd606f52f94bb6369fef4f16f73a | [
"MIT"
] | null | null | null | HiC_count_bin_linkages_singleChr_diagonal_v1a.py | elifesciences-publications/Stadlerlab-hi-c | 95e304bf8cb2cd606f52f94bb6369fef4f16f73a | [
"MIT"
] | null | null | null | """
This script takes a paired alignment file and, assigns each end to a bin (some chunk of
a chromosome defined by supplied bin size), and prints out the bin-bin counts for only
contacts within some width (controlled by width variable, currently set to 500 bins) of
the diagonal (distance between the bins).
Pri... | 27.617647 | 107 | 0.667732 |
4a0950728dfe34dd05b5d6b699644e0c26cfee8e | 1,144 | py | Python | setup.py | a1black/booktag | f96572c5dc27fa674084e2a35b043d846337a9dc | [
"MIT"
] | null | null | null | setup.py | a1black/booktag | f96572c5dc27fa674084e2a35b043d846337a9dc | [
"MIT"
] | null | null | null | setup.py | a1black/booktag | f96572c5dc27fa674084e2a35b043d846337a9dc | [
"MIT"
] | null | null | null | import setuptools
setuptools.setup(
name='booktag-a1black',
version='0.0.1',
author='a1black',
description='A simple script for fill in the tags in an audio book.',
license='GPLv2',
url='https://github.com/a1black/booktag',
classifiers=[
'Environment :: Console',
'Intended... | 26 | 73 | 0.55507 |
4a095084b55c57d26a64ca0109389bcf13501e1f | 747 | py | Python | tbats/abstract/__init__.py | arita37/tbats | 4e726919f08e39e74dd70a592b5258dfc7b25953 | [
"MIT"
] | 1 | 2019-07-21T15:38:12.000Z | 2019-07-21T15:38:12.000Z | tbats/abstract/__init__.py | arita37/tbats | 4e726919f08e39e74dd70a592b5258dfc7b25953 | [
"MIT"
] | null | null | null | tbats/abstract/__init__.py | arita37/tbats | 4e726919f08e39e74dd70a592b5258dfc7b25953 | [
"MIT"
] | null | null | null | from .ArrayHelper import ArrayHelper
from .MatrixBuilderInterface import MatrixBuilderInterface
from .MatrixBuilderCache import MatrixBuilderCache
from .MatrixBuilder import MatrixBuilder
from .Model import Model
from .ModelParams import ModelParams
from .Components import Components
from .ComponentMatrix import Compon... | 43.941176 | 117 | 0.821954 |
4a0950981a1882e84f2d1e75c5bd45d38b882cc7 | 105 | py | Python | toggl_report/toggl_report_app/apps.py | naokodama/toggl_report | 5280ec40b27872b90c72e07613829f7091ce302f | [
"MIT"
] | null | null | null | toggl_report/toggl_report_app/apps.py | naokodama/toggl_report | 5280ec40b27872b90c72e07613829f7091ce302f | [
"MIT"
] | null | null | null | toggl_report/toggl_report_app/apps.py | naokodama/toggl_report | 5280ec40b27872b90c72e07613829f7091ce302f | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class TogglReportAppConfig(AppConfig):
name = 'toggl_report_app'
| 17.5 | 38 | 0.790476 |
4a0951f3537d8db27e48cc4006861e052f92d0e3 | 8,832 | py | Python | 2. DCT and Quantization Algorithm/Assignment_2_DCT.py | IbrahimEl-Shal/Digital_Video_Processing | ce5649dba94ba5c50bc3fe6740d3059a99a6ea8f | [
"MIT"
] | 2 | 2021-03-08T01:59:33.000Z | 2021-03-08T01:59:39.000Z | 2. DCT and Quantization Algorithm/Assignment_2_DCT.py | IbrahimEl-Shal/Digital_Video_Processing | ce5649dba94ba5c50bc3fe6740d3059a99a6ea8f | [
"MIT"
] | null | null | null | 2. DCT and Quantization Algorithm/Assignment_2_DCT.py | IbrahimEl-Shal/Digital_Video_Processing | ce5649dba94ba5c50bc3fe6740d3059a99a6ea8f | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Fri Oct 25 19:53:08 2019
@author: Ibrahim El-Shal
Assignment 2:
- Develop a DCT algorithm to encode images in YUV format.
- Use 8x8 block and computer the DCT coefficients.
- Use a quantization of your choice.
- Reconstruct the images using IDCT.
- Compute the PSNR between t... | 27.428571 | 96 | 0.592618 |
4a09521672248a4fe42f013838f8948c5c86b788 | 10,015 | py | Python | mmaction/third_party/ActivityNet/Evaluation/eval_kinetics.py | Lill98/mmaction_custom_data | a174e995b78a936a7c80a1feb884cbfa801af740 | [
"Apache-2.0"
] | 20 | 2021-08-18T06:53:17.000Z | 2022-02-24T06:45:10.000Z | mmaction/third_party/ActivityNet/Evaluation/eval_kinetics.py | Lill98/mmaction_custom_data | a174e995b78a936a7c80a1feb884cbfa801af740 | [
"Apache-2.0"
] | 6 | 2021-08-25T08:11:46.000Z | 2021-10-08T07:42:08.000Z | mmaction/third_party/ActivityNet/Evaluation/eval_kinetics.py | Lill98/mmaction_custom_data | a174e995b78a936a7c80a1feb884cbfa801af740 | [
"Apache-2.0"
] | 3 | 2018-09-22T14:05:25.000Z | 2021-01-29T04:22:52.000Z | import json
import urllib.request, urllib.error, urllib.parse
import numpy as np
import pandas as pd
from utils import get_blocked_videos
from utils import interpolated_prec_rec
class ANETclassification(object):
GROUND_TRUTH_FIELDS = ['database', 'taxonomy', 'version']
PREDICTION_FIELDS = ['results', 'versio... | 40.06 | 80 | 0.602796 |
4a0952188f1360035a26ad582dff54c5b2fc58f3 | 1,093 | py | Python | database.py | snakems/karmator_bot | 27cddc6355998bd8765539de0f70906867dfd13a | [
"MIT"
] | 10 | 2018-01-18T11:58:37.000Z | 2021-12-24T13:52:59.000Z | database.py | snakems/karmator_bot | 27cddc6355998bd8765539de0f70906867dfd13a | [
"MIT"
] | 6 | 2020-07-23T21:12:16.000Z | 2021-06-25T15:23:42.000Z | database.py | snakems/karmator_bot | 27cddc6355998bd8765539de0f70906867dfd13a | [
"MIT"
] | 7 | 2020-10-26T13:08:01.000Z | 2022-01-30T18:49:26.000Z | import os
import peewee as pw
from playhouse.db_url import connect
from logger import db_log
DB_ADDRESS = os.environ["DATABASE_URL"]
db = connect(DB_ADDRESS)
db_log.debug(f"Create database with address {DB_ADDRESS}")
# В запросах в програме использованы логические
# операторы поскольку (из документации Peewee):
#... | 21.431373 | 58 | 0.755718 |
4a09532a06987cf5d2594f41b52f4396cbde3c4d | 3,802 | py | Python | refinery/units/misc/datefix.py | jhhcs/refinery | 8173e4006f9c28ad2043806b7e29adce4849985b | [
"BSD-3-Clause"
] | 1 | 2022-02-13T20:57:15.000Z | 2022-02-13T20:57:15.000Z | refinery/units/misc/datefix.py | baderj/refinery | 801c900a7184dfd47f5455124fbcfb4cf68814ed | [
"BSD-3-Clause"
] | null | null | null | refinery/units/misc/datefix.py | baderj/refinery | 801c900a7184dfd47f5455124fbcfb4cf68814ed | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from re import compile as re_compile
from datetime import datetime, timedelta
from refinery.units import arg, Unit
from refinery.lib.decorators import linewise
class datefix(Unit):
"""
Parses all kinds of date _formats and unifies them into the same format.
... | 34.252252 | 125 | 0.490005 |
4a09532fa18c32427c7daa339f7c068f0527305b | 432 | py | Python | tests/test_guardduty/test_server.py | gtourkas/moto | 307104417b579d23d02f670ff55217a2d4a16bee | [
"Apache-2.0"
] | 5,460 | 2015-01-01T01:11:17.000Z | 2022-03-31T23:45:38.000Z | tests/test_guardduty/test_server.py | gtourkas/moto | 307104417b579d23d02f670ff55217a2d4a16bee | [
"Apache-2.0"
] | 4,475 | 2015-01-05T19:37:30.000Z | 2022-03-31T13:55:12.000Z | tests/test_guardduty/test_server.py | gtourkas/moto | 307104417b579d23d02f670ff55217a2d4a16bee | [
"Apache-2.0"
] | 1,831 | 2015-01-14T00:00:44.000Z | 2022-03-31T20:30:04.000Z | import json
import sure # noqa # pylint: disable=unused-import
import moto.server as server
def test_create_without_enable_option():
backend = server.create_backend_app("guardduty")
test_client = backend.test_client()
body = {"enable": "True"}
response = test_client.post("/detector", data=json.dump... | 28.8 | 67 | 0.733796 |
4a0953e0d6fe193cdee29faea54961c5f58f71e7 | 3,358 | py | Python | ant_colony.py | Sherlock-Jerry/AntColonyOptimization | 11f30c60f84165a12c85377cfe9f12e62390bd1f | [
"MIT"
] | 75 | 2017-05-05T16:28:29.000Z | 2022-03-24T03:20:57.000Z | ant_colony.py | Sherlock-Jerry/AntColonyOptimization | 11f30c60f84165a12c85377cfe9f12e62390bd1f | [
"MIT"
] | 5 | 2018-02-15T19:16:04.000Z | 2020-04-01T10:56:51.000Z | ant_colony.py | Sherlock-Jerry/AntColonyOptimization | 11f30c60f84165a12c85377cfe9f12e62390bd1f | [
"MIT"
] | 43 | 2018-06-13T22:49:50.000Z | 2022-03-20T17:17:39.000Z | import random as rn
import numpy as np
from numpy.random import choice as np_choice
class AntColony(object):
def __init__(self, distances, n_ants, n_best, n_iterations, decay, alpha=1, beta=1):
"""
Args:
distances (2D numpy.array): Square matrix of distances. Diagonal is assumed to be ... | 38.597701 | 156 | 0.6081 |
4a0954690f1184be071609e124a74a1bf96a6e74 | 1,088 | py | Python | LeetCode/Python3/BinaryTree/513. Find Bottom Left Tree Value.py | WatsonWangZh/CodingPractice | dc057dd6ea2fc2034e14fd73e07e73e6364be2ae | [
"MIT"
] | 11 | 2019-09-01T22:36:00.000Z | 2021-11-08T08:57:20.000Z | LeetCode/Python3/BinaryTree/513. Find Bottom Left Tree Value.py | WatsonWangZh/LeetCodePractice | dc057dd6ea2fc2034e14fd73e07e73e6364be2ae | [
"MIT"
] | null | null | null | LeetCode/Python3/BinaryTree/513. Find Bottom Left Tree Value.py | WatsonWangZh/LeetCodePractice | dc057dd6ea2fc2034e14fd73e07e73e6364be2ae | [
"MIT"
] | 2 | 2020-05-27T14:58:52.000Z | 2020-05-27T15:04:17.000Z | # Given a binary tree, find the leftmost value in the last row of the tree.
# Example 1:
# Input:
# 2
# / \
# 1 3
# Output:
# 1
# Example 2:
# Input:
# 1
# / \
# 2 3
# / / \
# 4 5 6
# /
# 7
# Output:
# 7
# Note: You may assume the tree (i.e., the given roo... | 21.333333 | 75 | 0.460478 |
4a09551f2ac677c755ca0269fc3b60ae3977a1cd | 16,974 | py | Python | ross/fluid_flow/fluid_flow_coefficients.py | JuliaMota/ross | 88c2fa69d9a583dcdc33eab8deb35c797ebf4ef8 | [
"MIT"
] | null | null | null | ross/fluid_flow/fluid_flow_coefficients.py | JuliaMota/ross | 88c2fa69d9a583dcdc33eab8deb35c797ebf4ef8 | [
"MIT"
] | null | null | null | ross/fluid_flow/fluid_flow_coefficients.py | JuliaMota/ross | 88c2fa69d9a583dcdc33eab8deb35c797ebf4ef8 | [
"MIT"
] | null | null | null | import sys
from math import isnan
import numpy as np
from scipy import integrate
from scipy.optimize import least_squares
# fmt: off
from ross.fluid_flow.fluid_flow_geometry import (move_rotor_center,
move_rotor_center_abs)
# fmt: on
def calculate_oil_film_force(flu... | 35.961864 | 113 | 0.588429 |
4a095532678c7c595c56968abb7bdaac8a7a3e01 | 263 | py | Python | deepthought/channels.py | ndsystems/deepthought | 2d206bd5cc71191c00d6cc2b60868f6fdce33828 | [
"MIT"
] | 3 | 2021-06-15T07:02:30.000Z | 2022-03-04T15:34:09.000Z | deepthought/channels.py | ndsystems/deepthought | 2d206bd5cc71191c00d6cc2b60868f6fdce33828 | [
"MIT"
] | 1 | 2021-06-18T06:58:12.000Z | 2021-06-18T06:58:12.000Z | deepthought/channels.py | ndsystems/deepthought | 2d206bd5cc71191c00d6cc2b60868f6fdce33828 | [
"MIT"
] | null | null | null | class ChannelConfig:
def __init__(self, name):
self.name = name
self.detector = None
self.exposure = None
self.marker = None
self.detect_with = None
def __repr__(self):
return f"{self.name}, {self.marker}"
| 23.909091 | 44 | 0.585551 |
4a09553995241b3ea9c3d40ec6bab5ffe0efa093 | 19,765 | py | Python | python_module/SuperGLU/Util/PythonDirectLibs/flask_oauth_fork/flask_oauth.py | GeneralizedLearningUtilities/SuperGLU | 1c373d1358431fb96dd70b324b26a14fc8ed1fcb | [
"MIT"
] | 8 | 2015-07-13T23:07:20.000Z | 2020-11-13T21:09:55.000Z | python_module/SuperGLU/Util/PythonDirectLibs/flask_oauth_fork/flask_oauth.py | GeneralizedLearningUtilities/SuperGLU | 1c373d1358431fb96dd70b324b26a14fc8ed1fcb | [
"MIT"
] | 7 | 2016-01-13T12:13:56.000Z | 2021-12-14T21:12:28.000Z | python_module/SuperGLU/Util/PythonDirectLibs/flask_oauth_fork/flask_oauth.py | GeneralizedLearningUtilities/SuperGLU | 1c373d1358431fb96dd70b324b26a14fc8ed1fcb | [
"MIT"
] | 6 | 2015-09-23T17:53:32.000Z | 2020-04-30T07:27:01.000Z | # -*- coding: utf-8 -*-
"""
flask_oauth
~~~~~~~~~~~
Implements basic OAuth support for Flask.
:copyright: (c) 2010 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
Fork notice: this is a copy take from https://github.com/mitsuhiko/flask-oauth
for version 0.13 (commit 09ebf28 "This is 0.13"). The foll... | 40.921325 | 108 | 0.603744 |
4a0955cc9e399c32d6184b44aca7354b1a763e45 | 64 | py | Python | A/281A.py | johnggo/Codeforces-Solutions | 4127ae6f72294b5781fb94c42b69cfef570aae42 | [
"MIT"
] | 1 | 2020-08-25T19:59:11.000Z | 2020-08-25T19:59:11.000Z | A/281A.py | johnggo/Codeforces-Solutions | 4127ae6f72294b5781fb94c42b69cfef570aae42 | [
"MIT"
] | null | null | null | A/281A.py | johnggo/Codeforces-Solutions | 4127ae6f72294b5781fb94c42b69cfef570aae42 | [
"MIT"
] | null | null | null | word = str(input())
sol = word[0].upper() + word[1:]
print(sol)
| 16 | 32 | 0.59375 |
4a095657660a0b4086b5795d6b4c9ae2ea2298de | 1,176 | py | Python | mindinsight/datavisual/data_transform/image_container.py | fapbatista/mindinsight | db5769eb80cbd13a2a9af7682c11f5667d8bf141 | [
"Apache-2.0"
] | 216 | 2020-03-28T02:11:56.000Z | 2022-03-31T06:20:09.000Z | mindinsight/datavisual/data_transform/image_container.py | fapbatista/mindinsight | db5769eb80cbd13a2a9af7682c11f5667d8bf141 | [
"Apache-2.0"
] | 13 | 2020-03-31T03:00:12.000Z | 2021-01-03T13:01:06.000Z | mindinsight/datavisual/data_transform/image_container.py | fapbatista/mindinsight | db5769eb80cbd13a2a9af7682c11f5667d8bf141 | [
"Apache-2.0"
] | 21 | 2020-03-28T02:41:06.000Z | 2021-11-24T12:20:25.000Z | # Copyright 2020 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 37.935484 | 78 | 0.694728 |
4a09572ee7c07b76e5dea4851196cc4434f443e3 | 7,652 | py | Python | perfkitbenchmarker/linux_packages/blazemark.py | YueLee90/PerfKitBenchmarker | 6bd92986fa35e9456ef40a872c749292f66ded23 | [
"Apache-2.0"
] | null | null | null | perfkitbenchmarker/linux_packages/blazemark.py | YueLee90/PerfKitBenchmarker | 6bd92986fa35e9456ef40a872c749292f66ded23 | [
"Apache-2.0"
] | null | null | null | perfkitbenchmarker/linux_packages/blazemark.py | YueLee90/PerfKitBenchmarker | 6bd92986fa35e9456ef40a872c749292f66ded23 | [
"Apache-2.0"
] | 1 | 2021-12-07T13:29:48.000Z | 2021-12-07T13:29:48.000Z | # Copyright 2016 PerfKitBenchmarker 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 appli... | 34.468468 | 80 | 0.647151 |
4a095821f4eaba241840646f3cc1499276ba5c70 | 3,248 | py | Python | tensorboard/plugins/mesh/mesh_demo.py | kevint324/tensorboard | cbc5b1f2d74236d89baa9d4810c166e4cee973a9 | [
"Apache-2.0"
] | 1 | 2021-05-10T10:46:37.000Z | 2021-05-10T10:46:37.000Z | tensorboard/plugins/mesh/mesh_demo.py | kevint324/tensorboard | cbc5b1f2d74236d89baa9d4810c166e4cee973a9 | [
"Apache-2.0"
] | 2 | 2022-02-15T12:29:44.000Z | 2022-03-02T13:26:06.000Z | tensorboard/plugins/mesh/mesh_demo.py | kevint324/tensorboard | cbc5b1f2d74236d89baa9d4810c166e4cee973a9 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 31.533981 | 80 | 0.660099 |
4a0958fb7472aae6b02acbe1ea0af3b766c05192 | 539 | py | Python | streamdeck-plugin/src/event_handlers/hand_toggle_event_handler.py | andrewachen/streamdeck-googlemeet | 957e22e6e6e9cc962192ef049771714513e29fb3 | [
"MIT"
] | 124 | 2020-09-10T14:45:40.000Z | 2022-03-30T21:33:26.000Z | streamdeck-plugin/src/event_handlers/hand_toggle_event_handler.py | andrewachen/streamdeck-googlemeet | 957e22e6e6e9cc962192ef049771714513e29fb3 | [
"MIT"
] | 24 | 2020-10-20T23:43:01.000Z | 2022-03-07T10:23:41.000Z | streamdeck-plugin/src/event_handlers/hand_toggle_event_handler.py | andrewachen/streamdeck-googlemeet | 957e22e6e6e9cc962192ef049771714513e29fb3 | [
"MIT"
] | 11 | 2020-10-13T03:16:49.000Z | 2022-01-23T22:03:30.000Z | from event_handlers.base_toggle_event_handler import BaseToggleEventHandler
class HandToggleEventHandler(BaseToggleEventHandler):
"""
A Stream Deck button that shows whether or not your hand is raised,
and toggles the hand on and off when you press the button.
"""
STREAM_DECK_ACTION = "com.chrisr... | 33.6875 | 75 | 0.781076 |
4a09593f129f729fea2d81bd94090e1dc7575d9d | 906 | py | Python | setup.py | yunus-ceyhan/kivyx | f4348eb8c00ad62346b827d1ab6197f8f84cde8e | [
"MIT"
] | 1 | 2022-03-28T07:27:32.000Z | 2022-03-28T07:27:32.000Z | setup.py | yunus-ceyhan/kivyx | f4348eb8c00ad62346b827d1ab6197f8f84cde8e | [
"MIT"
] | null | null | null | setup.py | yunus-ceyhan/kivyx | f4348eb8c00ad62346b827d1ab6197f8f84cde8e | [
"MIT"
] | null | null | null | from setuptools import setup, find_packages
from os import path
this_directory = path.abspath(path.dirname(__file__))
with open(path.join(this_directory, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
setup(
name='kivyx',
packages=find_packages(
include=["kivyx","kivyx.*"]
... | 25.885714 | 73 | 0.599338 |
4a095a5b735896a63d3142acf3747193d3b2ec97 | 17,395 | py | Python | xlib/image/ImageProcessor.py | Arthurzhangsheng/DeepFaceLive | 6d12c8f64e1ab042909adec44371dc91d395e606 | [
"MIT"
] | 4 | 2021-07-23T16:34:24.000Z | 2022-03-01T18:31:59.000Z | xlib/image/ImageProcessor.py | Arthurzhangsheng/DeepFaceLive | 6d12c8f64e1ab042909adec44371dc91d395e606 | [
"MIT"
] | null | null | null | xlib/image/ImageProcessor.py | Arthurzhangsheng/DeepFaceLive | 6d12c8f64e1ab042909adec44371dc91d395e606 | [
"MIT"
] | null | null | null | from enum import IntEnum
from typing import Tuple, Union
import cupy as cp
import cupyx.scipy.ndimage
import cv2
import numexpr as ne
import numpy as np
import scipy
import scipy.ndimage
class ImageProcessor:
"""
Generic image processor for numpy or cupy images
arguments
img np.ndarray|
... | 30.252174 | 183 | 0.522047 |
4a095c94d22d363ad8beeb43b1775aee9f84ae3d | 4,794 | py | Python | ensime_shared/config.py | mic47/ensime-vim | 4ceb76797ba598bccbceeae4d76c7d70a29ae04a | [
"MIT"
] | null | null | null | ensime_shared/config.py | mic47/ensime-vim | 4ceb76797ba598bccbceeae4d76c7d70a29ae04a | [
"MIT"
] | null | null | null | ensime_shared/config.py | mic47/ensime-vim | 4ceb76797ba598bccbceeae4d76c7d70a29ae04a | [
"MIT"
] | null | null | null | # coding: utf-8
import collections
import os
import sexpdata
from ensime_shared.util import Util
BOOTSTRAPS_ROOT = os.path.join(os.environ['HOME'], '.config', 'ensime-vim')
"""Default directory where ENSIME server bootstrap projects will be created."""
LOG_FORMAT = '%(levelname)-8s <%(asctime)s> (%(filename)s:%(li... | 33.524476 | 97 | 0.605131 |
4a095caaf687a03d63e2cc8541859abdbb69bdfb | 3,247 | py | Python | databases/regression/randPolynomialEquationSystem/100systems_100samplesPerSys.py | Mortrack/CenyML | b54080d01491c89b311dfde3b980434db04de4d2 | [
"Apache-2.0"
] | null | null | null | databases/regression/randPolynomialEquationSystem/100systems_100samplesPerSys.py | Mortrack/CenyML | b54080d01491c89b311dfde3b980434db04de4d2 | [
"Apache-2.0"
] | null | null | null | databases/regression/randPolynomialEquationSystem/100systems_100samplesPerSys.py | Mortrack/CenyML | b54080d01491c89b311dfde3b980434db04de4d2 | [
"Apache-2.0"
] | null | null | null |
# --------------------------------------------------------------------------- #
# --------------------------------------------------------------------------- #
# AUTHOR: César Miranda Meza
# COMPLETITION DATE: September 21, 2021.
# LAST UPDATE: November 08, 2021.
#
# This code is used to create a database for certain ... | 63.666667 | 208 | 0.63166 |
4a095d1098c0691c7837ebbf718843aa29881870 | 22,736 | py | Python | python-profiles/STANDA/8MID12-1-H.py | EPC-MSU/libximc | b0349721f57c8274b098a7b646d7ae67b8e70b9d | [
"BSD-2-Clause"
] | 3 | 2020-12-08T14:41:48.000Z | 2022-02-23T13:42:42.000Z | python-profiles/STANDA/8MID12-1-H.py | EPC-MSU/libximc | b0349721f57c8274b098a7b646d7ae67b8e70b9d | [
"BSD-2-Clause"
] | 4 | 2020-12-08T20:15:06.000Z | 2021-12-08T14:15:24.000Z | python-profiles/STANDA/8MID12-1-H.py | EPC-MSU/libximc | b0349721f57c8274b098a7b646d7ae67b8e70b9d | [
"BSD-2-Clause"
] | 2 | 2020-11-02T02:17:35.000Z | 2021-03-18T14:13:56.000Z | def set_profile_8MID12_1_H(lib, id):
worst_result = Result.Ok
result = Result.Ok
feedback_settings = feedback_settings_t()
feedback_settings.IPS = 4000
class FeedbackType_:
FEEDBACK_ENCODER_MEDIATED = 6
FEEDBACK_NONE = 5
FEEDBACK_EMF = 4
FEEDBACK_ENCODER = 1
fee... | 35.974684 | 185 | 0.693658 |
4a095e43baea72d6a9009c918c67aa28fd4ab16f | 4,187 | py | Python | mbeddr2C_MM/transformation_from_mps/Hlayer1rule10.py | levilucio/SyVOLT | 7526ec794d21565e3efcc925a7b08ae8db27d46a | [
"MIT"
] | 3 | 2017-06-02T19:26:27.000Z | 2021-06-14T04:25:45.000Z | mbeddr2C_MM/transformation_from_mps/Hlayer1rule10.py | levilucio/SyVOLT | 7526ec794d21565e3efcc925a7b08ae8db27d46a | [
"MIT"
] | 8 | 2016-08-24T07:04:07.000Z | 2017-05-26T16:22:47.000Z | mbeddr2C_MM/transformation_from_mps/Hlayer1rule10.py | levilucio/SyVOLT | 7526ec794d21565e3efcc925a7b08ae8db27d46a | [
"MIT"
] | 1 | 2019-10-31T06:00:23.000Z | 2019-10-31T06:00:23.000Z | from core.himesis import Himesis
import uuid
class Hlayer1rule10(Himesis):
def __init__(self):
"""
Creates the himesis graph representing the DSLTrans rule layer1rule10.
"""
# Flag this instance as compiled now
self.is_compiled = True
super(Hlayer1rule10, self).__init__(name='Hlayer1rule10', num_nodes=0,... | 38.768519 | 114 | 0.712443 |
4a095f3d051425aabe415aeaea3efa618df07ba3 | 8,495 | py | Python | peripteras/users/api/views.py | tsaklidis/e-peripteras | 39634ca07de535c6a1188af636e394a8966672ca | [
"MIT"
] | null | null | null | peripteras/users/api/views.py | tsaklidis/e-peripteras | 39634ca07de535c6a1188af636e394a8966672ca | [
"MIT"
] | null | null | null | peripteras/users/api/views.py | tsaklidis/e-peripteras | 39634ca07de535c6a1188af636e394a8966672ca | [
"MIT"
] | 1 | 2020-12-27T05:16:54.000Z | 2020-12-27T05:16:54.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import re
from collections import Counter
from django.conf import settings
from django.core.exceptions import SuspiciousOperation
from django.http import Http404
from django.shortcuts import get_object_or_404
from django.db.models import Q, FieldDoesNotExist
from django.u... | 33.577075 | 79 | 0.559152 |
4a095f643cb2dac4318731470902b34dddffc324 | 3,850 | py | Python | examples/diffuse_pyramid.py | almarklein/pirt | b43a57aad89ad2638a65e58079153567a49a43f2 | [
"BSD-3-Clause"
] | 10 | 2020-05-14T12:48:23.000Z | 2022-03-24T15:03:00.000Z | examples/diffuse_pyramid.py | almarklein/pirt | b43a57aad89ad2638a65e58079153567a49a43f2 | [
"BSD-3-Clause"
] | 1 | 2021-08-05T13:24:48.000Z | 2021-08-09T13:01:21.000Z | examples/diffuse_pyramid.py | almarklein/pirt | b43a57aad89ad2638a65e58079153567a49a43f2 | [
"BSD-3-Clause"
] | null | null | null | """ Demonstrates the scale space pyramid with Gaussian diffusion.
"""
import numpy as np
from pirt import ScaleSpacePyramid
from pirt import Aarray
class Demo2D:
def __init__(self, im):
# Make Aarray
im = Aarray(im)
# Create pyramid
self._p = ScaleSpacePyramid(i... | 28.518519 | 83 | 0.562857 |
4a095f78c2a09879d364178aedb33daa68e081fd | 2,218 | py | Python | setup.py | nurmukhametov/ROPgadget | 15ffb1b08d64991ecdd4131e07e8a3118930c629 | [
"BSD-3-Clause"
] | null | null | null | setup.py | nurmukhametov/ROPgadget | 15ffb1b08d64991ecdd4131e07e8a3118930c629 | [
"BSD-3-Clause"
] | null | null | null | setup.py | nurmukhametov/ROPgadget | 15ffb1b08d64991ecdd4131e07e8a3118930c629 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
from setuptools import setup
import os
package_name = "ROPGadget"
package_dir = "ropgadget"
package_description = """
This tool lets you search your gadgets on your binaries to facilitate your ROP exploitation.
ROPgadget supports ELF, PE and Mach-O format on x86, x64, ARM, ARM64, P... | 32.617647 | 109 | 0.608656 |
4a095fd190ccfeafb1daf94154a3cebc27c54b0c | 2,466 | py | Python | dassl/data/samplers.py | DMIRLAB-Group/Dassl.pytorch | 79052448cc0b0622f14e9768dbd6e6c0598fe6d1 | [
"MIT"
] | 1 | 2021-12-11T23:37:02.000Z | 2021-12-11T23:37:02.000Z | dassl/data/samplers.py | DMIRLAB-Group/Dassl.pytorch | 79052448cc0b0622f14e9768dbd6e6c0598fe6d1 | [
"MIT"
] | null | null | null | dassl/data/samplers.py | DMIRLAB-Group/Dassl.pytorch | 79052448cc0b0622f14e9768dbd6e6c0598fe6d1 | [
"MIT"
] | 1 | 2020-09-21T03:16:10.000Z | 2020-09-21T03:16:10.000Z | import copy
import random
from collections import defaultdict
from torch.utils.data.sampler import Sampler, RandomSampler, SequentialSampler
class RandomDomainSampler(Sampler):
"""Randomly sample N domains each with K
images to form a minibatch.
"""
def __init__(self, data_source, batch_size, n_domai... | 31.615385 | 78 | 0.642336 |
4a09606d303f53f5ae45b0c0c1005187bcf21764 | 17 | py | Python | example_snippets/multimenus_snippets/Snippets/NumPy/Vectorized (universal) functions/Characterizing arrays/any Returns True if any of the elements of a evaluate to True.py | kuanpern/jupyterlab-snippets-multimenus | 477f51cfdbad7409eab45abe53cf774cd70f380c | [
"BSD-3-Clause"
] | null | null | null | example_snippets/multimenus_snippets/Snippets/NumPy/Vectorized (universal) functions/Characterizing arrays/any Returns True if any of the elements of a evaluate to True.py | kuanpern/jupyterlab-snippets-multimenus | 477f51cfdbad7409eab45abe53cf774cd70f380c | [
"BSD-3-Clause"
] | null | null | null | example_snippets/multimenus_snippets/Snippets/NumPy/Vectorized (universal) functions/Characterizing arrays/any Returns True if any of the elements of a evaluate to True.py | kuanpern/jupyterlab-snippets-multimenus | 477f51cfdbad7409eab45abe53cf774cd70f380c | [
"BSD-3-Clause"
] | 1 | 2021-02-04T04:51:48.000Z | 2021-02-04T04:51:48.000Z | np.any(a, axis=0) | 17 | 17 | 0.647059 |
4a0960a50f2218a0e8249ba39f1011fd234930dd | 9,782 | py | Python | builder/make_cards.py | tomcontileslie/slid | 5b8a06f482bff5c46e1dd92981695e5c5d743b79 | [
"MIT"
] | 1 | 2020-11-02T23:35:26.000Z | 2020-11-02T23:35:26.000Z | builder/make_cards.py | stanightline/slid | 453beee93d48fec8edbcb172a35ebdef7d64e543 | [
"MIT"
] | 3 | 2020-09-03T15:35:47.000Z | 2020-09-13T10:55:07.000Z | builder/make_cards.py | stanightline/slid | 453beee93d48fec8edbcb172a35ebdef7d64e543 | [
"MIT"
] | 3 | 2020-09-05T21:02:27.000Z | 2021-11-10T17:40:42.000Z | from bs4 import BeautifulSoup
import sys
import yaml
import os
SOURCE, OUTPUT = sys.argv[1], sys.argv[2]
with open(os.path.join(SOURCE, "_colours.yml"), "r") as file:
colours = yaml.load(file, Loader=yaml.FullLoader)
ESCDICT = {
"&" : "&",
"<" : "<",
">" : ">",
'"' : "&... | 30.006135 | 108 | 0.530464 |
4a0960d9d781cc63c5d5516f2c5f5f40b2b5917c | 2,683 | py | Python | dataset/archive/compare_distribution.py | marcelbra/academic-budget-bert | 527053a618d781210b4faccb5fe9afef17b1324a | [
"Apache-2.0"
] | null | null | null | dataset/archive/compare_distribution.py | marcelbra/academic-budget-bert | 527053a618d781210b4faccb5fe9afef17b1324a | [
"Apache-2.0"
] | null | null | null | dataset/archive/compare_distribution.py | marcelbra/academic-budget-bert | 527053a618d781210b4faccb5fe9afef17b1324a | [
"Apache-2.0"
] | null | null | null | import pickle
from datasets import load_dataset, load_from_disk
from nltk import word_tokenize, sent_tokenize
import matplotlib.pyplot as plt
from tqdm import tqdm
import multiprocessing as mp
def get_density(doc, closed_class_words, word_tokenizer):
words = word_tokenizer(doc)
count = sum([1 for word in words if wo... | 35.302632 | 101 | 0.641446 |
4a096198e26d7e3f609c106942faa66be2f27c7c | 4,491 | py | Python | bfevfl/file.py | asteriation/acnh-eventflow-compiler | 821b2b5f4e7c31ccdf46a7743ccfcd0e3219a4f8 | [
"MIT"
] | 1 | 2022-01-25T22:12:54.000Z | 2022-01-25T22:12:54.000Z | bfevfl/file.py | asteriation/acnh-eventflow-compiler | 821b2b5f4e7c31ccdf46a7743ccfcd0e3219a4f8 | [
"MIT"
] | null | null | null | bfevfl/file.py | asteriation/acnh-eventflow-compiler | 821b2b5f4e7c31ccdf46a7743ccfcd0e3219a4f8 | [
"MIT"
] | null | null | null | from __future__ import annotations
from typing import List, Set
from bitstring import BitStream, pack
from .actors import Actor
from .nodes import Node, RootNode, SubflowNode, ActionNode, SwitchNode
from .block import DataBlock, ContainerBlock
from .str_ import StringPool
from .dic_ import Dictionary
from .array imp... | 35.928 | 105 | 0.611668 |
4a0962a7d6a31e5153b4f1f833dfca09f0d41a60 | 524 | py | Python | preprocspectra/transformation_tools/__init__.py | dijsilva/preprocspectra | 66b0400d3869307c340ec288cff71443c1acf8d8 | [
"MIT"
] | 1 | 2021-09-03T09:38:28.000Z | 2021-09-03T09:38:28.000Z | preprocspectra/transformation_tools/__init__.py | dijsilva/preprocspectra | 66b0400d3869307c340ec288cff71443c1acf8d8 | [
"MIT"
] | null | null | null | preprocspectra/transformation_tools/__init__.py | dijsilva/preprocspectra | 66b0400d3869307c340ec288cff71443c1acf8d8 | [
"MIT"
] | 1 | 2020-09-06T07:53:36.000Z | 2020-09-06T07:53:36.000Z | __all__ = ['snv', 'sg', 'plus_sg', 'area_norm', 'msc', 'make_transformations']
from preprocspectra.transformation_tools.transformations import snv
from preprocspectra.transformation_tools.transformations import sg
from preprocspectra.transformation_tools.transformations import plus_sg
from preprocspectra.transformatio... | 47.636364 | 92 | 0.870229 |
4a096380ef182a07bfb906f6766308c886d79f72 | 9,114 | py | Python | test/test27_send.py | Zrufy/telepot | a4d62a32c82e5799e9f7afc400275e9d487ddb76 | [
"MIT"
] | 2 | 2021-04-11T12:03:19.000Z | 2021-04-11T12:03:23.000Z | test/test27_send.py | Zrufy/telepot | a4d62a32c82e5799e9f7afc400275e9d487ddb76 | [
"MIT"
] | null | null | null | test/test27_send.py | Zrufy/telepot | a4d62a32c82e5799e9f7afc400275e9d487ddb76 | [
"MIT"
] | null | null | null | # coding=utf8
import time
import threading
import pprint
import sys
import traceback
import telepot
import telepot.namedtuple
"""
This script tests:
- setWebhook() and getUpdates(), and make sure they are exclusive
- sendZZZ() and sendChatAction() methods
- getUserProfilePhotos()
Run it by:
$ python2.7 test.py <toke... | 31.867133 | 144 | 0.678078 |
4a0963ce80d4cb7a130adaee5cde846ec1e9648a | 8,983 | py | Python | source/resolveCue.py | networkdynamics/attribution-extraction | 5f4420769ea74f1c358ff8a2423fa8ca9083b4fc | [
"MIT"
] | 3 | 2018-03-08T21:38:42.000Z | 2020-05-01T14:14:22.000Z | source/resolveCue.py | networkdynamics/attribution-extraction | 5f4420769ea74f1c358ff8a2423fa8ca9083b4fc | [
"MIT"
] | null | null | null | source/resolveCue.py | networkdynamics/attribution-extraction | 5f4420769ea74f1c358ff8a2423fa8ca9083b4fc | [
"MIT"
] | null | null | null | from operator import itemgetter
def linkCue(article, verbs, nouns):
attrs = article.attributions
sentences = article.sentences
keys = attrs.keys()
print 'cueresolving'
for key in keys:
currentAttr = attrs[key]
contentSpan = currentAttr['content']
sourceSpan = currentAttr['source']
if contentSpan == [... | 22.071253 | 156 | 0.666036 |
4a0965236ee4411127927ef186e79d332eaed71e | 2,982 | py | Python | torchaudio/models/wav2vec2/utils/import_huggingface.py | z-a-f/audio | d64648b6ea4e5ec4e000d4eb26daa3f2499ef3ca | [
"BSD-2-Clause"
] | null | null | null | torchaudio/models/wav2vec2/utils/import_huggingface.py | z-a-f/audio | d64648b6ea4e5ec4e000d4eb26daa3f2499ef3ca | [
"BSD-2-Clause"
] | null | null | null | torchaudio/models/wav2vec2/utils/import_huggingface.py | z-a-f/audio | d64648b6ea4e5ec4e000d4eb26daa3f2499ef3ca | [
"BSD-2-Clause"
] | null | null | null | """Import Hugging Face transformers's wav2vec2.0 pretrained weights to torchaudios's format.
"""
import logging
from torch.nn import Module
from ..model import Wav2Vec2Model, _get_model
_LG = logging.getLogger(__name__)
def _get_config(cfg):
config = {
'extractor_mode': f'{cfg.feat_extract_norm}_norm',... | 37.746835 | 97 | 0.705231 |
4a096581cd11536143f4a249f90089e8c5f4a77d | 1,944 | py | Python | app/src/processing.py | NilaiVemula/flask-azure | 9b3d78964fc5caa65ed584f73800768a5be9d90c | [
"MIT"
] | null | null | null | app/src/processing.py | NilaiVemula/flask-azure | 9b3d78964fc5caa65ed584f73800768a5be9d90c | [
"MIT"
] | null | null | null | app/src/processing.py | NilaiVemula/flask-azure | 9b3d78964fc5caa65ed584f73800768a5be9d90c | [
"MIT"
] | null | null | null | import numpy as np
from cv2 import connectedComponents, connectedComponentsWithStats, watershed, dilate, erode, distanceTransform, DIST_L2, CC_STAT_AREA
# make sure im is only 0 and 255
def clean_im(im):
im = im * 255
im[im != 255] = 0
return im
def postprocessing(im, thre_discard, wid_dilate):
# di... | 27 | 133 | 0.643519 |
4a096589cd391cfb06c4ad1d0b63b92dc8f94ac8 | 4,061 | py | Python | script/ota.py | xiongyu0523/azure-sphere-external-mcu-ota | b09aa865a83f84e741d26a2edf0c4e94b0f0f724 | [
"MIT"
] | 3 | 2020-07-29T08:32:44.000Z | 2020-11-23T05:16:35.000Z | script/ota.py | xiongyu0523/azure-sphere-external-mcu-ota | b09aa865a83f84e741d26a2edf0c4e94b0f0f724 | [
"MIT"
] | null | null | null | script/ota.py | xiongyu0523/azure-sphere-external-mcu-ota | b09aa865a83f84e741d26a2edf0c4e94b0f0f724 | [
"MIT"
] | 1 | 2020-07-29T08:32:47.000Z | 2020-07-29T08:32:47.000Z | import os
import sys
import re
import argparse
import json
import hashlib
from datetime import datetime, timedelta
from azure.iot.hub import IoTHubRegistryManager
from azure.iot.hub import IoTHubConfigurationManager
from azure.iot.hub import models
from azure.storage.blob import BlobServiceClient, generate_container_sa... | 41.865979 | 168 | 0.713371 |
4a096676f25796379f637c214b8dc3f7edee5b56 | 2,171 | py | Python | Lib/idlelib/idle_test/test_pyshell.py | shawwn/cpython | 0ff8a3b374286d2218fc18f47556a5ace202dad3 | [
"0BSD"
] | 2,441 | 2020-07-31T06:45:53.000Z | 2022-03-30T15:56:49.000Z | Lib/idlelib/idle_test/test_pyshell.py | shawwn/cpython | 0ff8a3b374286d2218fc18f47556a5ace202dad3 | [
"0BSD"
] | 427 | 2017-09-29T22:54:36.000Z | 2022-02-15T19:26:50.000Z | Lib/idlelib/idle_test/test_pyshell.py | shawwn/cpython | 0ff8a3b374286d2218fc18f47556a5ace202dad3 | [
"0BSD"
] | 671 | 2017-09-21T08:04:01.000Z | 2022-03-29T14:30:07.000Z | "Test pyshell, coverage 12%."
# Plus coverage of test_warning. Was 20% with test_openshell.
from idlelib import pyshell
import unittest
from test.support import requires
from tkinter import Tk
class FunctionTest(unittest.TestCase):
# Test stand-alone module level non-gui functions.
def test_restart_line_wi... | 33.4 | 78 | 0.639337 |
4a0966df7b7b4543945c52b8d5a88bc59dafcea3 | 9,568 | py | Python | ASHMC/courses/views.py | haaksmash/Webfront | 8eb942394c568c681a83bc2c375d7552f4b3a30c | [
"Apache-2.0"
] | null | null | null | ASHMC/courses/views.py | haaksmash/Webfront | 8eb942394c568c681a83bc2c375d7552f4b3a30c | [
"Apache-2.0"
] | null | null | null | ASHMC/courses/views.py | haaksmash/Webfront | 8eb942394c568c681a83bc2c375d7552f4b3a30c | [
"Apache-2.0"
] | null | null | null | from django.views.generic import View
from django.views.generic.base import TemplateView, TemplateResponseMixin
from django import http
from django.utils import simplejson as json
from django.db.models import Q
from django.core.paginator import Paginator, InvalidPage, EmptyPage
from django.core.exceptions import Object... | 40.542373 | 110 | 0.556334 |
4a096743f8e23530d80c2b7fbfc9b5a6c60c294b | 4,839 | py | Python | samples/opensource/sampleUffMaskRCNN/converted/mrcnn_to_trt_single.py | gabrielibagon/TensorRT | f9233dbb7b5d09e6f4014dc5ac766f066db57d85 | [
"Apache-2.0"
] | null | null | null | samples/opensource/sampleUffMaskRCNN/converted/mrcnn_to_trt_single.py | gabrielibagon/TensorRT | f9233dbb7b5d09e6f4014dc5ac766f066db57d85 | [
"Apache-2.0"
] | null | null | null | samples/opensource/sampleUffMaskRCNN/converted/mrcnn_to_trt_single.py | gabrielibagon/TensorRT | f9233dbb7b5d09e6f4014dc5ac766f066db57d85 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2019, NVIDIA CORPORATION. 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/li... | 29.150602 | 118 | 0.689399 |
4a0968850544c67bd7466c40fa233ffd856ee040 | 2,685 | py | Python | aliyun-python-sdk-smartag/aliyunsdksmartag/request/v20180313/ListAccessPointsRequest.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | 1,001 | 2015-07-24T01:32:41.000Z | 2022-03-25T01:28:18.000Z | aliyun-python-sdk-smartag/aliyunsdksmartag/request/v20180313/ListAccessPointsRequest.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | 363 | 2015-10-20T03:15:00.000Z | 2022-03-08T12:26:19.000Z | aliyun-python-sdk-smartag/aliyunsdksmartag/request/v20180313/ListAccessPointsRequest.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | 682 | 2015-09-22T07:19:02.000Z | 2022-03-22T09:51:46.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... | 38.913043 | 83 | 0.762011 |
4a0969189445dbfcda9395110506c649c681e178 | 2,121 | py | Python | src/python/pants/backend/jvm/tasks/jvm_compile/zinc/zinc_analysis_parser.py | lahosken/pants | 1b0340987c9b2eab9411416803c75b80736716e4 | [
"Apache-2.0"
] | 1 | 2018-12-10T21:31:02.000Z | 2018-12-10T21:31:02.000Z | src/python/pants/backend/jvm/tasks/jvm_compile/zinc/zinc_analysis_parser.py | lahosken/pants | 1b0340987c9b2eab9411416803c75b80736716e4 | [
"Apache-2.0"
] | 2 | 2016-10-13T21:37:42.000Z | 2018-07-20T20:14:33.000Z | src/python/pants/backend/jvm/tasks/jvm_compile/zinc/zinc_analysis_parser.py | lahosken/pants | 1b0340987c9b2eab9411416803c75b80736716e4 | [
"Apache-2.0"
] | 1 | 2021-11-11T14:04:12.000Z | 2021-11-11T14:04:12.000Z | # coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
from pants.backend.j... | 37.210526 | 96 | 0.722772 |
4a09699d8a1603e1cc1e10f93ea91faaa500a632 | 6,918 | py | Python | src/binwalk/modules/hexdiff.py | foreni-packages/binwalk- | cdfcfff21b6b4a880d70b7754ad73878b01894c9 | [
"MIT"
] | null | null | null | src/binwalk/modules/hexdiff.py | foreni-packages/binwalk- | cdfcfff21b6b4a880d70b7754ad73878b01894c9 | [
"MIT"
] | null | null | null | src/binwalk/modules/hexdiff.py | foreni-packages/binwalk- | cdfcfff21b6b4a880d70b7754ad73878b01894c9 | [
"MIT"
] | null | null | null | import os
import sys
import curses
import string
import platform
import binwalk.core.common as common
from binwalk.core.compat import *
from binwalk.core.module import Module, Option, Kwarg
class HexDiff(Module):
COLORS = {
'red' : '31',
'green' : '32',
'blue' : '34',
}
SEPERA... | 32.027778 | 103 | 0.514021 |
4a09699faacc3cad0545f230cbc22e4683754f3e | 4,520 | py | Python | apps/gromacs/benchmark.py | t-young31/excalibur-tests | 039d2fe450c65975b829b7feb5bd2f7aaa48f67a | [
"Apache-2.0"
] | null | null | null | apps/gromacs/benchmark.py | t-young31/excalibur-tests | 039d2fe450c65975b829b7feb5bd2f7aaa48f67a | [
"Apache-2.0"
] | null | null | null | apps/gromacs/benchmark.py | t-young31/excalibur-tests | 039d2fe450c65975b829b7feb5bd2f7aaa48f67a | [
"Apache-2.0"
] | null | null | null | """
Strong scaling of GROMACS. Uses the benchmark simulation from
https://www.hecbiosim.ac.uk/access-hpc/benchmarks
"""
import os
import math
import reframe as rfm
import reframe.utility.sanity as sn
from abc import abstractmethod
from reframe.core.decorators import run_before, run_after
this_dir = os.path.dirname(__f... | 32.517986 | 96 | 0.622124 |
4a096aba9954de4b1f8042f4470e9878955cbc9e | 4,966 | py | Python | multiphonon/redutils.py | granrothge/multiphonon | 486a998eeb6b73b964a58ba0f98fe3ece15bdf6e | [
"MIT"
] | 1 | 2019-05-22T08:46:09.000Z | 2019-05-22T08:46:09.000Z | multiphonon/redutils.py | granrothge/multiphonon | 486a998eeb6b73b964a58ba0f98fe3ece15bdf6e | [
"MIT"
] | 118 | 2016-04-04T12:27:15.000Z | 2021-08-18T01:46:13.000Z | multiphonon/redutils.py | granrothge/multiphonon | 486a998eeb6b73b964a58ba0f98fe3ece15bdf6e | [
"MIT"
] | 5 | 2017-09-28T16:01:12.000Z | 2020-01-31T18:58:09.000Z | import os, sys
def _createDefaultMantidUserConfig(facility='SNS'):
# create default Mantid user configuration for DEMO purpose.
import os
mantid_config_path = os.path.expanduser('~/.mantid/Mantid.user.properties')
mantid_user_dir = os.path.dirname(mantid_config_path)
if not os.path.exists(mantid_co... | 34.727273 | 151 | 0.627064 |
4a096ae72f6696576069a0f41a103ea60b77363d | 1,525 | py | Python | surrogate/crossover/cxOnePoint.py | liujiamingustc/phd | 4f815a738abad43531d02ac66f5bd0d9a1def52a | [
"Apache-2.0"
] | 3 | 2021-01-06T03:01:18.000Z | 2022-03-21T03:02:55.000Z | surrogate/crossover/cxOnePoint.py | liujiamingustc/phd | 4f815a738abad43531d02ac66f5bd0d9a1def52a | [
"Apache-2.0"
] | null | null | null | surrogate/crossover/cxOnePoint.py | liujiamingustc/phd | 4f815a738abad43531d02ac66f5bd0d9a1def52a | [
"Apache-2.0"
] | null | null | null | # Copyright 2016 Quan Pan
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | 38.125 | 83 | 0.717377 |
4a096b05a87be9d486c35b691ab65c8c1610c536 | 2,783 | py | Python | Taiyun/clean/taiyun.py | seucs/entity-linker | 0156ad9b9d6439ea15518828513da9d9699b9acd | [
"Apache-2.0"
] | 4 | 2018-03-07T07:59:58.000Z | 2019-10-19T09:31:44.000Z | Taiyun/clean/taiyun.py | acmom/entity-linker | 0156ad9b9d6439ea15518828513da9d9699b9acd | [
"Apache-2.0"
] | null | null | null | Taiyun/clean/taiyun.py | acmom/entity-linker | 0156ad9b9d6439ea15518828513da9d9699b9acd | [
"Apache-2.0"
] | 2 | 2018-11-05T16:09:07.000Z | 2019-11-07T00:22:37.000Z | #coding=utf8
import sys
import json
import re
import MySQLdb
from MySQLdb import cursors
reload(sys)
sys.setdefaultencoding('utf8')
# 生成Title数据表
def setTitle():
label_path = '1.0_clean_baidu_labels_zh.nt'
no_zhPattern = re.compile(u'[^\u4e00-\u9fa5]+')
count = 0
for s in open(label_path,'r'):
... | 25.53211 | 80 | 0.537549 |
4a096bcf4917f56237ab30cc7810fdbdb6b898dc | 2,345 | py | Python | common/crypto.py | james-m/realchat | cfe6e1b3c419cafdc6fe03c1a344810acc96d924 | [
"BSD-3-Clause"
] | 1 | 2015-03-03T18:17:20.000Z | 2015-03-03T18:17:20.000Z | common/crypto.py | james-m/realchat | cfe6e1b3c419cafdc6fe03c1a344810acc96d924 | [
"BSD-3-Clause"
] | null | null | null | common/crypto.py | james-m/realchat | cfe6e1b3c419cafdc6fe03c1a344810acc96d924 | [
"BSD-3-Clause"
] | null | null | null | # -*- Mode: Python; tab-width: 4 -*-
# Copyright (c) 2012 James McKernan
# 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... | 41.875 | 82 | 0.767591 |
4a096ca3fef40d131546241a4d42b852e0d95f16 | 1,454 | py | Python | AutomatedTesting/Gem/PythonTests/assetpipeline/ap_fixtures/ap_fast_scan_setting_backup_fixture.py | cypherdotXd/o3de | bb90c4ddfe2d495e9c00ebf1e2650c6d603a5676 | [
"Apache-2.0",
"MIT"
] | 8 | 2021-08-31T02:14:19.000Z | 2021-12-28T19:20:59.000Z | AutomatedTesting/Gem/PythonTests/assetpipeline/ap_fixtures/ap_fast_scan_setting_backup_fixture.py | cypherdotXd/o3de | bb90c4ddfe2d495e9c00ebf1e2650c6d603a5676 | [
"Apache-2.0",
"MIT"
] | 8 | 2021-07-12T13:55:00.000Z | 2021-10-04T14:53:21.000Z | AutomatedTesting/Gem/PythonTests/assetpipeline/ap_fixtures/ap_fast_scan_setting_backup_fixture.py | cypherdotXd/o3de | bb90c4ddfe2d495e9c00ebf1e2650c6d603a5676 | [
"Apache-2.0",
"MIT"
] | 1 | 2021-09-16T05:06:18.000Z | 2021-09-16T05:06:18.000Z | """
Copyright (c) Contributors to the Open 3D Engine Project.
For complete copyright and license terms please see the LICENSE at the root of this distribution.
SPDX-License-Identifier: Apache-2.0 OR MIT
Fixtures for handling system settings entry for FastScanEnabled
"""
# Import builtin libraries
import pytest
imp... | 30.93617 | 97 | 0.772352 |
4a096d1d0c577317f31a943c4e90472c31c8f15b | 1,651 | py | Python | pagarmeapisdk/models/get_transfer_target_response.py | pagarme/pagarme-python-sdk | 5a709ce54d46fc7326f73242700602c1c5a6bd26 | [
"MIT"
] | null | null | null | pagarmeapisdk/models/get_transfer_target_response.py | pagarme/pagarme-python-sdk | 5a709ce54d46fc7326f73242700602c1c5a6bd26 | [
"MIT"
] | null | null | null | pagarmeapisdk/models/get_transfer_target_response.py | pagarme/pagarme-python-sdk | 5a709ce54d46fc7326f73242700602c1c5a6bd26 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
pagarmeapisdk
This file was automatically generated by APIMATIC v3.0 (
https://www.apimatic.io ).
"""
class GetTransferTargetResponse(object):
"""Implementation of the 'GetTransferTargetResponse' model.
TODO: type model description here.
Attributes:
... | 26.629032 | 79 | 0.5851 |
4a096d3c6b61b1d5b85ee50ba9a95999374841f9 | 27,372 | py | Python | files/Irina/Irina.py | HenraL/NSI_1ereG6_Programme_Python | 9f46b848fa2331daca57e5e2e11cba41da45a67f | [
"Unlicense"
] | 1 | 2021-06-15T13:44:47.000Z | 2021-06-15T13:44:47.000Z | files/Irina/Irina.py | HenraL/NSI_1ereG6_Programme_Python | 9f46b848fa2331daca57e5e2e11cba41da45a67f | [
"Unlicense"
] | null | null | null | files/Irina/Irina.py | HenraL/NSI_1ereG6_Programme_Python | 9f46b848fa2331daca57e5e2e11cba41da45a67f | [
"Unlicense"
] | null | null | null | import math, random
from time import sleep
print ("""
def hypothenus(a,b):
c=sqrt(a**2+b**2)
return c
print (hypothenus(3,4))
h=int(input("opzerpoezrzperezproezjrpzer: "))
b=int(input("dhaoiahreozaheozaheza:"))
def airetrianglerectangle(b,h):
a=b*h/2
return a
print ("aire du triangle rectangle {}".for... | 71.467363 | 12,238 | 0.526414 |
4a097170ff6e0f8792d07f93ddd6877f7f8e61ae | 910 | py | Python | remote/models/ClientCloudHostMapping.py | zadjii/nebula | 50c4ec019c9f7eb15fe105a6c53a8a12880e281c | [
"MIT"
] | 2 | 2020-04-15T11:20:59.000Z | 2021-05-12T13:01:36.000Z | remote/models/ClientCloudHostMapping.py | zadjii/nebula | 50c4ec019c9f7eb15fe105a6c53a8a12880e281c | [
"MIT"
] | 1 | 2018-06-05T04:48:56.000Z | 2018-06-05T04:48:56.000Z | remote/models/ClientCloudHostMapping.py | zadjii/nebula | 50c4ec019c9f7eb15fe105a6c53a8a12880e281c | [
"MIT"
] | 1 | 2018-08-15T06:45:46.000Z | 2018-08-15T06:45:46.000Z | from datetime import datetime, timedelta
from sqlalchemy import Column, Integer, String, DateTime, ForeignKey, Table, BigInteger
from sqlalchemy.orm import relationship, backref
from remote.models import nebr_base as base
__author__ = 'Mike'
class ClientCloudHostMapping(base):
__tablename__ = 'clientcloudhostma... | 33.703704 | 87 | 0.706593 |
4a09725f009baef669df040c26792a8215d6c230 | 3,026 | py | Python | nn.py | praxidike97/a-different-approach-to-neural-nets | 18ac64525f7e976077be6c92ec2091005f2b764f | [
"MIT"
] | null | null | null | nn.py | praxidike97/a-different-approach-to-neural-nets | 18ac64525f7e976077be6c92ec2091005f2b764f | [
"MIT"
] | null | null | null | nn.py | praxidike97/a-different-approach-to-neural-nets | 18ac64525f7e976077be6c92ec2091005f2b764f | [
"MIT"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
from keras.models import Sequential
from keras.layers import Dense
import keras.backend as K
from utils import generate_linear_unseparable_2d_distribution, to_one_hot, newline
NUM_HIDDEN = 1
def create_model(input_size, output_size):
model = Sequential()
mo... | 31.852632 | 104 | 0.631196 |
4a09730c5fcc5ba43dce57a2f0a508746febba52 | 66,180 | py | Python | volta/volta/encoders.py | e-bug/iglue | a3f1288c1c89fbc4c44ee0d6c01097348615bac6 | [
"MIT"
] | 15 | 2022-01-28T03:08:46.000Z | 2022-03-24T09:24:07.000Z | volta/volta/encoders.py | e-bug/iglue | a3f1288c1c89fbc4c44ee0d6c01097348615bac6 | [
"MIT"
] | 4 | 2022-03-01T19:13:39.000Z | 2022-03-27T08:21:46.000Z | volta/volta/encoders.py | e-bug/iglue | a3f1288c1c89fbc4c44ee0d6c01097348615bac6 | [
"MIT"
] | 2 | 2022-02-05T17:04:42.000Z | 2022-03-11T14:52:47.000Z | # Copyright (c) Facebook, Inc. and its affiliates.
# Copyright (c) 2020, Emanuele Bugliarello (@e-bug).
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import os
import copy
import math
import pickle
import logging
import torch
from torch im... | 48.8774 | 187 | 0.647189 |
4a09731fee39348f2cd63c4bab2fe0dfd3422937 | 11,335 | py | Python | ProgettoLube/WebInspector/venv/Lib/site-packages/tensorflow/_api/v2/compat/v1/distribute/__init__.py | Lube-Project/ProgettoLube | cbf33971e2c2e865783ec1a2302625539186a338 | [
"MIT"
] | null | null | null | ProgettoLube/WebInspector/venv/Lib/site-packages/tensorflow/_api/v2/compat/v1/distribute/__init__.py | Lube-Project/ProgettoLube | cbf33971e2c2e865783ec1a2302625539186a338 | [
"MIT"
] | null | null | null | ProgettoLube/WebInspector/venv/Lib/site-packages/tensorflow/_api/v2/compat/v1/distribute/__init__.py | Lube-Project/ProgettoLube | cbf33971e2c2e865783ec1a2302625539186a338 | [
"MIT"
] | 1 | 2021-01-28T01:57:41.000Z | 2021-01-28T01:57:41.000Z | # This file is MACHINE GENERATED! Do not edit.
# Generated by: tensorflow/python/tools/api/generator/create_python_api.py script.
"""Library for running a computation across multiple devices.
The intent of this library is that you can write an algorithm in a stylized way
and it will be usable with a variety of differe... | 55.837438 | 110 | 0.80397 |
4a0973dd6483ecc231d7d52888412c4c433b4bcb | 18,431 | py | Python | tests/test_gradient.py | MIBbrandon/tequila | 8e872e33b40c7dcfd58d998a61071f66034e39df | [
"MIT"
] | null | null | null | tests/test_gradient.py | MIBbrandon/tequila | 8e872e33b40c7dcfd58d998a61071f66034e39df | [
"MIT"
] | 3 | 2020-12-08T14:15:56.000Z | 2020-12-17T16:38:35.000Z | tests/test_gradient.py | clausia/tequila | a67fe808c165c5f30a30d9745cfb8155b47c7eca | [
"MIT"
] | null | null | null | import tequila.simulators.simulator_api
from tequila.circuit import gates
from tequila.circuit.gradient import grad
from tequila.objective import ExpectationValue
from tequila.objective.objective import Variable
from tequila.hamiltonian import paulis
from tequila.simulators.simulator_api import simulate
from tequila im... | 41.699095 | 120 | 0.639195 |
4a0974decd894c0362ae1ba158c59f5673a68f87 | 6,041 | py | Python | friendship/views.py | zhouye/shareit | 31f86c4e72a1994eeb9ffe433134894bd0d72503 | [
"MIT"
] | null | null | null | friendship/views.py | zhouye/shareit | 31f86c4e72a1994eeb9ffe433134894bd0d72503 | [
"MIT"
] | null | null | null | friendship/views.py | zhouye/shareit | 31f86c4e72a1994eeb9ffe433134894bd0d72503 | [
"MIT"
] | null | null | null | from django.contrib.auth.decorators import login_required
from django.conf import settings
try:
from django.contrib.auth import get_user_model
user_model = get_user_model()
except ImportError:
from django.contrib.auth.models import User
user_model = User
from django.shortcuts import render, get_object_... | 39.227273 | 115 | 0.754014 |
4a09750be30f727468b7bca9c6090e3d2920f906 | 396 | py | Python | trial/migrations/0028_globalchecker_new_orders.py | Alex394540/django_supplement_site | 0e1bb44608d9273968a7a65e2796ad388f2e72f5 | [
"MIT"
] | null | null | null | trial/migrations/0028_globalchecker_new_orders.py | Alex394540/django_supplement_site | 0e1bb44608d9273968a7a65e2796ad388f2e72f5 | [
"MIT"
] | null | null | null | trial/migrations/0028_globalchecker_new_orders.py | Alex394540/django_supplement_site | 0e1bb44608d9273968a7a65e2796ad388f2e72f5 | [
"MIT"
] | null | null | null | # Generated by Django 2.0.3 on 2018-04-08 17:50
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('trial', '0027_drug_product_image'),
]
operations = [
migrations.AddField(
model_name='globalchecker',
name='new_orde... | 20.842105 | 53 | 0.608586 |
4a0975299c2b73023d3bd4bbb9adcfb1c55e3ced | 668 | py | Python | test/test-species-name_suggest.py | bartaelterman/pygbif | 110e0cbcd8cb2b1813f6e27d66e95a95579d4643 | [
"MIT"
] | 37 | 2015-03-20T13:50:27.000Z | 2021-07-10T11:23:16.000Z | test/test-species-name_suggest.py | bartaelterman/pygbif | 110e0cbcd8cb2b1813f6e27d66e95a95579d4643 | [
"MIT"
] | 82 | 2015-10-30T06:12:48.000Z | 2021-07-13T12:20:57.000Z | test/test-species-name_suggest.py | bartaelterman/pygbif | 110e0cbcd8cb2b1813f6e27d66e95a95579d4643 | [
"MIT"
] | 12 | 2015-03-20T13:50:29.000Z | 2020-09-23T08:53:46.000Z | """Tests for species module - name_suggest methods"""
import vcr
import re
from pygbif import species
@vcr.use_cassette("test/vcr_cassettes/test_name_suggest.yaml")
def test_name_suggest():
"species.name_suggest - basic test"
res = species.name_suggest(q="Puma concolor")
assert list == res.__class__
a... | 29.043478 | 75 | 0.714072 |
4a09754fc4f5619b451a9ab8311237a611f7c031 | 503 | py | Python | src/56.py | cloudzfy/euler | b82efad753ee98375fd40ec4e3989be57828e82c | [
"MIT"
] | 12 | 2016-10-19T09:03:20.000Z | 2021-01-10T10:53:23.000Z | src/56.py | cloudzfy/euler | b82efad753ee98375fd40ec4e3989be57828e82c | [
"MIT"
] | null | null | null | src/56.py | cloudzfy/euler | b82efad753ee98375fd40ec4e3989be57828e82c | [
"MIT"
] | 6 | 2018-09-12T03:13:58.000Z | 2021-07-07T00:29:43.000Z | # A googol (10^100) is a massive number: one followed by one-hundred zeros;
# 100^100 is almost unimaginably large: one followed by two-hundred zeros.
# Despite their size, the sum of the digits in each number is only 1.
# Considering natural numbers of the form, ab, where a, b < 100, what is the
# maximum digital sum... | 29.588235 | 76 | 0.707753 |
4a09763c16677f3dcbd047cf9cfb0478314ef921 | 2,006 | py | Python | json_to_csv.py | ll320/NeuronCounting_Keras_Retinanet | c53b6a34ea354719808c159c9d993b114d7916a3 | [
"Apache-2.0"
] | null | null | null | json_to_csv.py | ll320/NeuronCounting_Keras_Retinanet | c53b6a34ea354719808c159c9d993b114d7916a3 | [
"Apache-2.0"
] | null | null | null | json_to_csv.py | ll320/NeuronCounting_Keras_Retinanet | c53b6a34ea354719808c159c9d993b114d7916a3 | [
"Apache-2.0"
] | null | null | null | import json
import os, glob
import cv2
import matplotlib.pyplot as plt
def read_image_paths():
imgs_path = sorted(glob.glob(os.path.join('data/train_2', '*.png')))
print(imgs_path)
return imgs_path
def read_img(path):
img = cv2.imread(path)
plt.figure()
plt.imshow(img)
plt.show()
ret... | 29.5 | 97 | 0.573779 |
4a097689f2215353c6c4c533af1a6d2608183282 | 7,044 | py | Python | elong_2018032810/util.py | mannuan/pyspider_script | f4c988912e1099eacd0322b4e9c3a87eaaaa526f | [
"Apache-2.0"
] | 9 | 2018-08-28T07:53:43.000Z | 2019-07-09T07:55:52.000Z | qunar_2018032720/util.py | mannuan/pyspider_script | f4c988912e1099eacd0322b4e9c3a87eaaaa526f | [
"Apache-2.0"
] | null | null | null | qunar_2018032720/util.py | mannuan/pyspider_script | f4c988912e1099eacd0322b4e9c3a87eaaaa526f | [
"Apache-2.0"
] | null | null | null | #-*- coding:utf-8 -*-
import time,random,re,sys,json
from pymongo import MongoClient
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.common.exceptions import TimeoutException
reload(sys)
sys.setdefaultencoding('utf8')
from driver import *
conn = MongoClient('localhost', 270... | 45.153846 | 173 | 0.626065 |
4a0976a9b7656b1e3ac4091f01882f660c84ad18 | 13,293 | py | Python | python/api/cluster/serializers.py | AKhodus/adcm | 98dbf22af3f1c6afa94505e9acaff0ac4088a602 | [
"Apache-2.0"
] | null | null | null | python/api/cluster/serializers.py | AKhodus/adcm | 98dbf22af3f1c6afa94505e9acaff0ac4088a602 | [
"Apache-2.0"
] | null | null | null | python/api/cluster/serializers.py | AKhodus/adcm | 98dbf22af3f1c6afa94505e9acaff0ac4088a602 | [
"Apache-2.0"
] | null | null | null | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | 39.212389 | 96 | 0.677123 |
4a09772d53882cad66d1eedd9c72991fa3aeddbb | 16,139 | py | Python | src/utils/siftscience.py | ResearchHub/ResearchHub-Backend-Open | d36dca33afae2d442690694bb2ab17180d84bcd3 | [
"MIT"
] | 18 | 2021-05-20T13:20:16.000Z | 2022-02-11T02:40:18.000Z | src/utils/siftscience.py | ResearchHub/ResearchHub-Backend-Open | d36dca33afae2d442690694bb2ab17180d84bcd3 | [
"MIT"
] | 109 | 2021-05-21T20:14:23.000Z | 2022-03-31T20:56:10.000Z | src/utils/siftscience.py | ResearchHub/ResearchHub-Backend-Open | d36dca33afae2d442690694bb2ab17180d84bcd3 | [
"MIT"
] | 4 | 2021-05-17T13:47:53.000Z | 2022-02-12T10:48:21.000Z | import json
import sift.client
from ipware import get_client_ip
from django.apps import apps
from researchhub.celery import app
from researchhub.settings import SIFT_ACCOUNT_ID, SIFT_REST_API_KEY
from utils import sentry
# https://sift.com/resources/guides/content-abuse
client = sift.Client(api_key=SIFT_REST_API_K... | 32.213573 | 110 | 0.585352 |
4a09780245a0ef09d18aa12974c69ee473d8fbae | 7,475 | py | Python | official/r1/mnist/mnist_tpu.py | zcdzcdzcd/models | a31b526a7617a152a138a865b5689bf5b59f655d | [
"Apache-2.0"
] | 3 | 2020-06-30T23:58:18.000Z | 2020-07-24T08:47:28.000Z | official/r1/mnist/mnist_tpu.py | zcdzcdzcd/models | a31b526a7617a152a138a865b5689bf5b59f655d | [
"Apache-2.0"
] | 1 | 2021-03-31T21:37:41.000Z | 2021-03-31T21:37:41.000Z | official/r1/mnist/mnist_tpu.py | zcdzcdzcd/models | a31b526a7617a152a138a865b5689bf5b59f655d | [
"Apache-2.0"
] | 2 | 2019-11-10T07:48:51.000Z | 2020-02-04T04:17:41.000Z | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 37.00495 | 80 | 0.713445 |
4a09784eb8503c0ad52de74d800b9acbe18c08fc | 1,153 | py | Python | cda/integration.py | Wellheor1/l2 | d980210921c545c68fe9d5522bb693d567995024 | [
"MIT"
] | null | null | null | cda/integration.py | Wellheor1/l2 | d980210921c545c68fe9d5522bb693d567995024 | [
"MIT"
] | null | null | null | cda/integration.py | Wellheor1/l2 | d980210921c545c68fe9d5522bb693d567995024 | [
"MIT"
] | null | null | null | import json
import logging
from urllib.parse import urljoin, urlencode
import requests
from appconf.manager import SettingManager
logger = logging.getLogger(__name__)
def get_url(path, query=None):
if query is None:
query = {}
base = SettingManager.get_cda_base_url()
if not base or base == 'emp... | 27.452381 | 117 | 0.652212 |
4a0978b78bb895bd9e68b36a09b5c46aa3d42eaf | 125 | py | Python | Parte 1/Semana 2/DigitoDaDezena.py | GabrielReira/Computer-Science-USP | 47a3cb68ccaa08f7302fbd9d9905ca80cee432cb | [
"MIT"
] | null | null | null | Parte 1/Semana 2/DigitoDaDezena.py | GabrielReira/Computer-Science-USP | 47a3cb68ccaa08f7302fbd9d9905ca80cee432cb | [
"MIT"
] | null | null | null | Parte 1/Semana 2/DigitoDaDezena.py | GabrielReira/Computer-Science-USP | 47a3cb68ccaa08f7302fbd9d9905ca80cee432cb | [
"MIT"
] | null | null | null | n = int(input('Digite um número inteiro: '))
dezena = n % 100
dígito = dezena // 10
print('O dígito das dezenas é', dígito) | 20.833333 | 44 | 0.664 |
4a0978d0dd71580d4dd28a31f6e860a3b37e9be4 | 5,154 | py | Python | human/model/train.py | Vtn21/HuMAn | 024eb6c57e4c19d3b97db3681e7aca1adea644c1 | [
"MIT"
] | null | null | null | human/model/train.py | Vtn21/HuMAn | 024eb6c57e4c19d3b97db3681e7aca1adea644c1 | [
"MIT"
] | 7 | 2021-02-05T19:47:25.000Z | 2021-03-05T13:37:14.000Z | human/model/train.py | Vtn21/HuMAn | 024eb6c57e4c19d3b97db3681e7aca1adea644c1 | [
"MIT"
] | null | null | null | """train.py
Author: Victor T. N.
"""
import os
from datetime import datetime
from human.utils import dataset
os.environ["TF_CPP_MIN_LOG_LEVEL"] = "1" # Hide unnecessary TF messages
import tensorflow as tf # noqa: E402
import tensorflow_addons as tfa # noqa: E402
SHUFFLE_BUFFER = 1000
def full_training_loop(mo... | 44.051282 | 79 | 0.555491 |
4a097b18f8d092cd3cc69e886da909e2a33e79ac | 1,803 | py | Python | Testing/encryption/enc.py | PedroGRivera/BCAI | f56f21db61e80d4a57df542e40bc49405ba5b41e | [
"Apache-2.0"
] | 1 | 2020-03-05T20:11:31.000Z | 2020-03-05T20:11:31.000Z | Testing/encryption/enc.py | PedroGRivera/BCAI | f56f21db61e80d4a57df542e40bc49405ba5b41e | [
"Apache-2.0"
] | null | null | null | Testing/encryption/enc.py | PedroGRivera/BCAI | f56f21db61e80d4a57df542e40bc49405ba5b41e | [
"Apache-2.0"
] | 1 | 2019-09-23T20:14:51.000Z | 2019-09-23T20:14:51.000Z | import os
from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes
from cryptography.hazmat.backends import default_backend
import time
def genKey(keyFile="", nonceFile="", keyLen=0):
f = open(keyFile, 'w')
f.close()
f = open(nonceFile, 'w')
f.close()
key = os.urandom(... | 26.514706 | 77 | 0.60843 |
4a097b6c9877261e6ba2c7348132558d3534fe70 | 1,902 | py | Python | antlir/vm/tests/test_initrd_break.py | facebookincubator/fs_image | 3515a24bb0e93176a5584bdc8839464fa28390d7 | [
"MIT"
] | 9 | 2019-12-02T20:17:35.000Z | 2020-06-13T16:34:25.000Z | antlir/vm/tests/test_initrd_break.py | facebookincubator/fs_image | 3515a24bb0e93176a5584bdc8839464fa28390d7 | [
"MIT"
] | 19 | 2019-11-22T23:30:04.000Z | 2020-07-16T18:05:48.000Z | antlir/vm/tests/test_initrd_break.py | facebookincubator/fs_image | 3515a24bb0e93176a5584bdc8839464fa28390d7 | [
"MIT"
] | 4 | 2019-12-04T19:03:28.000Z | 2020-06-13T16:34:29.000Z | #!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import importlib.resources
import subprocess
import tempfile
from antlir.fs_utils import Path
from antlir.tests.comm... | 33.368421 | 65 | 0.57939 |
4a097c32885d9049ccab01c616479257654fcac8 | 16,427 | py | Python | core/parameters.py | pvthinker/Nyles | 8d5989699127f4897c3591f01f218b2f796ba938 | [
"MIT"
] | 18 | 2019-09-18T12:31:10.000Z | 2021-12-12T11:39:28.000Z | core/parameters.py | pvthinker/Nyles | 8d5989699127f4897c3591f01f218b2f796ba938 | [
"MIT"
] | 2 | 2019-11-25T15:23:20.000Z | 2020-01-24T12:28:21.000Z | core/parameters.py | pvthinker/Nyles | 8d5989699127f4897c3591f01f218b2f796ba938 | [
"MIT"
] | 2 | 2020-06-03T12:44:17.000Z | 2021-12-12T11:39:28.000Z | import os
import json
import datetime
# List of categories that are needed in the defaults
CATEGORIES = ["model", "physics", "IO", "animation", "time", "discretization", "MPI", "multigrid", "user"]
# List of attributes that are needed for every parameter
ATTRIBUTES = ["type", "default", "avail", "doc"]
class Inexte... | 38.291375 | 106 | 0.556523 |
4a097d6aafbd128c81256e6133d07e20124885ac | 9,180 | py | Python | ansible/my_env/lib/python2.7/site-packages/ansible/modules/network/vyos/vyos_config.py | otus-devops-2019-02/yyashkin_infra | 0cd0c003884155ac922e3e301305ac202de7028c | [
"MIT"
] | 1 | 2019-04-16T21:23:15.000Z | 2019-04-16T21:23:15.000Z | ansible/my_env/lib/python2.7/site-packages/ansible/modules/network/vyos/vyos_config.py | otus-devops-2019-02/yyashkin_infra | 0cd0c003884155ac922e3e301305ac202de7028c | [
"MIT"
] | 5 | 2020-02-26T20:10:50.000Z | 2021-09-23T23:23:18.000Z | ansible/my_env/lib/python2.7/site-packages/ansible/modules/network/vyos/vyos_config.py | otus-devops-2019-02/yyashkin_infra | 0cd0c003884155ac922e3e301305ac202de7028c | [
"MIT"
] | 1 | 2020-02-13T14:24:57.000Z | 2020-02-13T14:24:57.000Z | #!/usr/bin/python
#
# This file is part of Ansible
#
# Ansible 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 3 of the License, or
# (at your option) any later version.
#
# Ansible is distribut... | 31.986063 | 129 | 0.673312 |
4a097eaf03cd3589529c1ecbaaf9253d27c0de69 | 1,041 | py | Python | test12.py | hihaha99/PyGame-SpaceInvaders | 1d9d3d4cc4683575ed03b7c5002840d456a3249a | [
"MIT"
] | null | null | null | test12.py | hihaha99/PyGame-SpaceInvaders | 1d9d3d4cc4683575ed03b7c5002840d456a3249a | [
"MIT"
] | null | null | null | test12.py | hihaha99/PyGame-SpaceInvaders | 1d9d3d4cc4683575ed03b7c5002840d456a3249a | [
"MIT"
] | null | null | null | import pygame, sys
from pygame.locals import *
pygame.init()
FPS = 30 # frames per second setting
fpsClock = pygame.time.Clock()
# set up the window
DISPLAYSURF = pygame.display.set_mode((400, 300), 0, 32)
pygame.display.set_caption('Animation')
WHITE = (255, 255, 255)
catImg = pygame.image.load('technology.png')
c... | 22.148936 | 56 | 0.568684 |
4a097ef6bedeb4a2405199d3b2bf306a73de2618 | 45,972 | py | Python | MRPy.py | mmaiarocha/Attenuation | c1115a9e3ec3d7973e1de86ac24f7792507b7d3d | [
"MIT"
] | null | null | null | MRPy.py | mmaiarocha/Attenuation | c1115a9e3ec3d7973e1de86ac24f7792507b7d3d | [
"MIT"
] | null | null | null | MRPy.py | mmaiarocha/Attenuation | c1115a9e3ec3d7973e1de86ac24f7792507b7d3d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import sys
import gzip as gz
import pickle as pk
import numpy as np
import pandas as pd
from warnings import warn
from scipy.interpolate import interp1d
from scipy.optimize import curve_fit
import matplotlib.pyplot as plt
#================================================... | 32.604255 | 78 | 0.402223 |
4a097f1b5987aa6cf67b58960e983bbc61cd183b | 9,081 | py | Python | twine/package.py | Acidburn0zzz/twine | 00d1d231d613bb5a912f2ae64c07bb232dad3091 | [
"Apache-2.0"
] | 2 | 2018-05-03T10:24:52.000Z | 2020-02-15T05:11:21.000Z | twine/package.py | Acidburn0zzz/twine | 00d1d231d613bb5a912f2ae64c07bb232dad3091 | [
"Apache-2.0"
] | null | null | null | twine/package.py | Acidburn0zzz/twine | 00d1d231d613bb5a912f2ae64c07bb232dad3091 | [
"Apache-2.0"
] | null | null | null | # Copyright 2015 Ian Cordasco
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, so... | 34.397727 | 88 | 0.616892 |
4a097f3f7f758a039f6e0380c171aa99afd5a038 | 986 | py | Python | tests/test_replace_word_tokens.py | Epse/mathparse | 18faaa8c56628a917e450451ef047fe84752a234 | [
"MIT"
] | 41 | 2017-02-11T00:07:05.000Z | 2022-03-22T12:45:34.000Z | tests/test_replace_word_tokens.py | xKatooo/mathparse | fc7b4546dba6b5e19c36576a1bdd6df1393c3fb6 | [
"MIT"
] | 22 | 2016-11-26T13:36:49.000Z | 2020-07-04T20:56:43.000Z | tests/test_replace_word_tokens.py | xKatooo/mathparse | fc7b4546dba6b5e19c36576a1bdd6df1393c3fb6 | [
"MIT"
] | 17 | 2017-09-30T21:49:45.000Z | 2021-03-04T10:56:23.000Z | from unittest import TestCase
from mathparse import mathparse
class EnglishWordTokenTestCase(TestCase):
def test_addition(self):
result = mathparse.replace_word_tokens('1 plus 1', language='ENG')
self.assertEqual(result, '1 + 1')
def test_thirty(self):
result = mathparse.replace_wor... | 29 | 74 | 0.628803 |
4a0983e387cdbb4514f8329987714ab9e754c940 | 260 | py | Python | dvgutils/pipeline/metrics_pipe.py | jagin/dvg-utils | a7d19ead75398b09a9f1e146464cf4227f06a476 | [
"MIT"
] | 7 | 2020-09-02T08:39:22.000Z | 2021-10-13T18:13:04.000Z | dvgutils/pipeline/metrics_pipe.py | jagin/dvg-utils | a7d19ead75398b09a9f1e146464cf4227f06a476 | [
"MIT"
] | null | null | null | dvgutils/pipeline/metrics_pipe.py | jagin/dvg-utils | a7d19ead75398b09a9f1e146464cf4227f06a476 | [
"MIT"
] | null | null | null | from ..modules import Metrics
class MetricsPipe:
def __init__(self):
self.metrics = Metrics().start()
def __call__(self, data):
return self.update(data)
def update(self, data):
self.metrics.update()
return data
| 17.333333 | 40 | 0.619231 |
4a09843b1cfed4a8b659685fd647d9513e522435 | 804 | py | Python | couchbase_utils/cb_tools/mc_stat.py | cgghali/TAF | 1de8dec77ad781c373e18d9c285befd534ac203a | [
"Apache-2.0"
] | null | null | null | couchbase_utils/cb_tools/mc_stat.py | cgghali/TAF | 1de8dec77ad781c373e18d9c285befd534ac203a | [
"Apache-2.0"
] | null | null | null | couchbase_utils/cb_tools/mc_stat.py | cgghali/TAF | 1de8dec77ad781c373e18d9c285befd534ac203a | [
"Apache-2.0"
] | null | null | null | from cb_tools.cb_tools_base import CbCmdBase
class McStat(CbCmdBase):
def __init__(self, shell_conn, username="Administrator",
password="password"):
CbCmdBase.__init__(self, shell_conn, "mcstat",
username=username, password=password)
def reset(self, bucket_... | 36.545455 | 64 | 0.506219 |
4a09844c4c1a49af4549a22e3402543979bbcc40 | 22,466 | py | Python | env/lib/python3.7/site-packages/numpy/core/tests/test_deprecations.py | JacobMiske/nuclear-database-APIs | bc9fb6afb9aa0d98dde5d744d8f22b2791597e78 | [
"MIT"
] | null | null | null | env/lib/python3.7/site-packages/numpy/core/tests/test_deprecations.py | JacobMiske/nuclear-database-APIs | bc9fb6afb9aa0d98dde5d744d8f22b2791597e78 | [
"MIT"
] | null | null | null | env/lib/python3.7/site-packages/numpy/core/tests/test_deprecations.py | JacobMiske/nuclear-database-APIs | bc9fb6afb9aa0d98dde5d744d8f22b2791597e78 | [
"MIT"
] | 1 | 2020-05-01T20:23:35.000Z | 2020-05-01T20:23:35.000Z | """
Tests related to deprecation warnings. Also a convenient place
to document how deprecations should eventually be turned into errors.
"""
from __future__ import division, absolute_import, print_function
import datetime
import sys
import operator
import warnings
import pytest
import shutil
import tempfile
import n... | 39.345009 | 91 | 0.635449 |
4a0984d93c808623cd12983a575ea1720382bd0f | 394 | py | Python | scripts/timezone.py | CWrath/tradekit | cf33024b3be68ea6e319e6f8309516bcb17fa9a5 | [
"Apache-2.0"
] | null | null | null | scripts/timezone.py | CWrath/tradekit | cf33024b3be68ea6e319e6f8309516bcb17fa9a5 | [
"Apache-2.0"
] | null | null | null | scripts/timezone.py | CWrath/tradekit | cf33024b3be68ea6e319e6f8309516bcb17fa9a5 | [
"Apache-2.0"
] | null | null | null | from datetime import datetime
import pytz
def is_dst():
"""Determine where or not Daylight Savings Time (DST)
is currently in effect"""
x = datetime(datetime.now().year, 1, 1, 0, 0, 0, tzinfo=pytz.timezone('US/Eastern'))
y = datetime.now(pytz.timezone('US/Eastern'))
# if DST is in effect, their ... | 28.142857 | 88 | 0.672589 |
4a098556922b3eaf12dac39e0624ff5ef7cb1a74 | 11,754 | py | Python | tensorboard/summary.py | EnjoyLifeFund/py36pkgs | 0ac677fbbfa7b6d8c527fe2c759ba05117b07fd2 | [
"MIT",
"BSD-2-Clause",
"BSD-3-Clause"
] | null | null | null | tensorboard/summary.py | EnjoyLifeFund/py36pkgs | 0ac677fbbfa7b6d8c527fe2c759ba05117b07fd2 | [
"MIT",
"BSD-2-Clause",
"BSD-3-Clause"
] | null | null | null | tensorboard/summary.py | EnjoyLifeFund/py36pkgs | 0ac677fbbfa7b6d8c527fe2c759ba05117b07fd2 | [
"MIT",
"BSD-2-Clause",
"BSD-3-Clause"
] | null | null | null | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 38.537705 | 88 | 0.68683 |
4a0985fdaaccb11b5f0c547d8b379ad95d280dab | 1,779 | py | Python | setup.py | Zapgram/treq | 86cca01d9d77bf5b90bf2c34e5d6b3dc90ada798 | [
"MIT"
] | 20 | 2015-01-06T11:13:26.000Z | 2019-12-04T02:22:03.000Z | setup.py | Zapgram/treq | 86cca01d9d77bf5b90bf2c34e5d6b3dc90ada798 | [
"MIT"
] | 13 | 2015-01-02T17:46:30.000Z | 2015-03-31T12:57:14.000Z | setup.py | CamilionEU/treq | b83c379ef58286be803e86927086d1b49d2c5245 | [
"MIT"
] | 10 | 2015-01-02T23:17:05.000Z | 2021-06-05T12:03:25.000Z | from setuptools import find_packages, setup
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Framework :: Twisted",
"Programming Language :: Python",
"Programmin... | 31.210526 | 78 | 0.541315 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.