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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7951ef9700a3118310b51c3ba35ef4d26320a2a7 | 3,372 | py | Python | Codeforces/648-2/A.py | dipta007/Competitive-Programming | 998d47f08984703c5b415b98365ddbc84ad289c4 | [
"MIT"
] | 6 | 2018-10-15T18:45:05.000Z | 2022-03-29T04:30:10.000Z | Codeforces/648-2/A.py | dipta007/Competitive-Programming | 998d47f08984703c5b415b98365ddbc84ad289c4 | [
"MIT"
] | null | null | null | Codeforces/648-2/A.py | dipta007/Competitive-Programming | 998d47f08984703c5b415b98365ddbc84ad289c4 | [
"MIT"
] | 4 | 2018-01-07T06:20:07.000Z | 2019-08-21T15:45:59.000Z | """ Python 3 compatibility tools. """
from __future__ import division, print_function
import itertools
import sys
import os
from io import BytesIO, IOBase
if sys.version_info[0] < 3:
input = raw_input
range = xrange
filter = itertools.ifilter
map = itertools.imap
zip = itertools.izip
def is_it_local():
... | 22.184211 | 73 | 0.575326 |
7951f019b6f150d910ee32876a498d97c4787e87 | 1,235 | py | Python | pymeasure/instruments/keithley/__init__.py | ronan-sensome/pymeasure | a88f73ee25e98ef976f3741c08a49da6c4d55f0d | [
"MIT"
] | 10 | 2019-01-23T05:52:59.000Z | 2021-11-19T02:56:20.000Z | pymeasure/instruments/keithley/__init__.py | ronan-sensome/pymeasure | a88f73ee25e98ef976f3741c08a49da6c4d55f0d | [
"MIT"
] | null | null | null | pymeasure/instruments/keithley/__init__.py | ronan-sensome/pymeasure | a88f73ee25e98ef976f3741c08a49da6c4d55f0d | [
"MIT"
] | 2 | 2020-01-27T04:40:48.000Z | 2020-07-17T03:41:16.000Z | #
# This file is part of the PyMeasure package.
#
# Copyright (c) 2013-2017 PyMeasure Developers
#
# 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 limit... | 45.740741 | 79 | 0.782186 |
7951f02f76b5e340b253b4bd106b53162328a893 | 479 | py | Python | 05_list_operation/numbers.py | Story5/python-crash-course | 9e4e663db83ea9821c1dac83f02106eef7a9a14d | [
"Apache-2.0"
] | null | null | null | 05_list_operation/numbers.py | Story5/python-crash-course | 9e4e663db83ea9821c1dac83f02106eef7a9a14d | [
"Apache-2.0"
] | null | null | null | 05_list_operation/numbers.py | Story5/python-crash-course | 9e4e663db83ea9821c1dac83f02106eef7a9a14d | [
"Apache-2.0"
] | null | null | null | for value in range(1,5):
print(value)
numbers = list(range(1,5))
print(numbers)
even_numbers = list(range(2,11,2))
print(even_numbers)
squares = []
for value in range(1,11):
square = value**2
squares.append(square)
print(squares)
squares2 = [value**2 for value in range(1,11)]
print(squares2)
players = ... | 20.826087 | 62 | 0.661795 |
7951f035cc0fa28f563ed8de28ad2e714acf11dd | 1,261 | py | Python | Mini5App/models.py | cs-fullstack-2019-spring/django-mini-project5-Joshtg1104 | 8584602b039a27a90dda122a70d5bc825be2562c | [
"Apache-2.0"
] | null | null | null | Mini5App/models.py | cs-fullstack-2019-spring/django-mini-project5-Joshtg1104 | 8584602b039a27a90dda122a70d5bc825be2562c | [
"Apache-2.0"
] | null | null | null | Mini5App/models.py | cs-fullstack-2019-spring/django-mini-project5-Joshtg1104 | 8584602b039a27a90dda122a70d5bc825be2562c | [
"Apache-2.0"
] | null | null | null | from django.db import models
from django.contrib.auth.models import User
# Create your models here.
class LoginModel(models.Model):
name = models.CharField(max_length=70, default="")
username = models.CharField(max_length=70, default="")
password1 = models.CharField(max_length=200, default="")
passwo... | 39.40625 | 102 | 0.736717 |
7951f18da3e226d30be5ede1f6e6c15a97bb94d6 | 1,659 | py | Python | two_d_nav/utils.py | ZikangXiong/two-d-nav-gym | 1ab3d5323e87d672f04a9c796f7ccabb752a6e67 | [
"MIT"
] | null | null | null | two_d_nav/utils.py | ZikangXiong/two-d-nav-gym | 1ab3d5323e87d672f04a9c796f7ccabb752a6e67 | [
"MIT"
] | 1 | 2021-09-06T21:34:21.000Z | 2021-09-07T04:26:57.000Z | two_d_nav/utils.py | ZikangXiong/two-d-nav-gym | 1ab3d5323e87d672f04a9c796f7ccabb752a6e67 | [
"MIT"
] | 1 | 2021-09-07T22:52:13.000Z | 2021-09-07T22:52:13.000Z | import math
import numpy as np
import pygame
from two_d_nav import config
def normalize_pos(pos: np.ndarray) -> np.ndarray:
map_size = np.array(config.map_size)
center = map_size / 2
radius = map_size - center
return (pos - center) / radius
def denormalize_pos(pos: np.ndarray) -> np.ndarray:
... | 26.333333 | 79 | 0.634117 |
7951f248e13460e8800bcb84f82eec6fff8f9743 | 657 | py | Python | vuln_manager/core/templatetags/vuln_extras.py | jobscry/vuln_manager | ac68308d923b0719b960e45c1b9ff37aab991c89 | [
"MIT"
] | null | null | null | vuln_manager/core/templatetags/vuln_extras.py | jobscry/vuln_manager | ac68308d923b0719b960e45c1b9ff37aab991c89 | [
"MIT"
] | null | null | null | vuln_manager/core/templatetags/vuln_extras.py | jobscry/vuln_manager | ac68308d923b0719b960e45c1b9ff37aab991c89 | [
"MIT"
] | null | null | null | from django import template
from django.utils.http import urlquote
from django.utils.safestring import mark_safe
from cpes.models import Item
register = template.Library()
@register.filter(needs_autoescape=False)
def qstring(val_dict, end_comma=True):
q_strings = []
for key, val in val_dict.items():
... | 27.375 | 65 | 0.692542 |
7951f463e59915f795016c4c60de636d4333f7dc | 11,920 | py | Python | q2_demux/plugin_setup.py | EmFord/q2-demux | d5dbcb3591d92fb6beff2d2ee7ba77c081907b71 | [
"BSD-3-Clause"
] | null | null | null | q2_demux/plugin_setup.py | EmFord/q2-demux | d5dbcb3591d92fb6beff2d2ee7ba77c081907b71 | [
"BSD-3-Clause"
] | null | null | null | q2_demux/plugin_setup.py | EmFord/q2-demux | d5dbcb3591d92fb6beff2d2ee7ba77c081907b71 | [
"BSD-3-Clause"
] | null | null | null | # ----------------------------------------------------------------------------
# Copyright (c) 2016-2019, QIIME 2 development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this software.
# ------------------------------------------------... | 43.663004 | 79 | 0.63255 |
7951f68ba610393d49116c00bab904fbcc380e11 | 1,612 | py | Python | app/__init__.py | adi6ntro/microblog | 85c1aad7f4081ebcf6b9038352c4bd1e726e8b13 | [
"MIT"
] | null | null | null | app/__init__.py | adi6ntro/microblog | 85c1aad7f4081ebcf6b9038352c4bd1e726e8b13 | [
"MIT"
] | null | null | null | app/__init__.py | adi6ntro/microblog | 85c1aad7f4081ebcf6b9038352c4bd1e726e8b13 | [
"MIT"
] | null | null | null | from flask import Flask
from config import Config
from flask_sqlalchemy import SQLAlchemy
from flask_migrate import Migrate
from flask_login import LoginManager
import logging
from logging.handlers import SMTPHandler, RotatingFileHandler
import os
app = Flask(__name__)
app.config.from_object(Config)
db = SQLAlchemy(ap... | 36.636364 | 79 | 0.675558 |
7951f763b65e285eb09ef170e1b0163141aa9eda | 19,690 | py | Python | pmaf/sequence/_multiple/_stream.py | mmtechslv/PhyloMAF | bab43dd4a4d2812951b1fdf4f1abb83edb79ea88 | [
"BSD-3-Clause"
] | 1 | 2021-07-02T06:24:17.000Z | 2021-07-02T06:24:17.000Z | pmaf/sequence/_multiple/_stream.py | mmtechslv/PhyloMAF | bab43dd4a4d2812951b1fdf4f1abb83edb79ea88 | [
"BSD-3-Clause"
] | 1 | 2021-06-28T12:02:46.000Z | 2021-06-28T12:02:46.000Z | pmaf/sequence/_multiple/_stream.py | mmtechslv/PhyloMAF | bab43dd4a4d2812951b1fdf4f1abb83edb79ea88 | [
"BSD-3-Clause"
] | null | null | null | import warnings
warnings.simplefilter("ignore", category=FutureWarning)
from shutil import copyfile
from pmaf.sequence._metakit import (
MultiSequenceMetabase,
MultiSequenceStreamBackboneMetabase,
)
from pmaf.sequence._multiple._multiple import MultiSequence
from pmaf.sequence import _shared as seq_shared
from... | 30.153139 | 88 | 0.521229 |
7951f76c643f4ee7ccc9214282c505e92cbf5651 | 7,767 | py | Python | django_baker/bakery.py | RobKuipers/django-baker | 8f523f67bc94f4da5cc74754db47e34c19d47627 | [
"BSD-3-Clause"
] | 1 | 2021-01-05T21:24:25.000Z | 2021-01-05T21:24:25.000Z | django_baker/bakery.py | RobKuipers/django-baker | 8f523f67bc94f4da5cc74754db47e34c19d47627 | [
"BSD-3-Clause"
] | 2 | 2021-09-28T15:50:00.000Z | 2021-09-28T16:05:20.000Z | django_baker/bakery.py | RobKuipers/django-baker | 8f523f67bc94f4da5cc74754db47e34c19d47627 | [
"BSD-3-Clause"
] | 1 | 2022-02-05T17:31:29.000Z | 2022-02-05T17:31:29.000Z | from __future__ import print_function
import os
import re
import itertools
from django.db.models.fields import SlugField
from django.template.loader import get_template
from django.template import Context
from six import iteritems
class Baker(object):
"""
Given a dictionary of apps and models, Baker wil... | 47.650307 | 119 | 0.597528 |
7951f837dd07fabae720689af49805b073c46ae9 | 2,243 | py | Python | mcycle/constants.py | momargoh/MCycle | 4eed4b80fe041527f9765f9b6ca135fce864ed0f | [
"Apache-2.0"
] | 7 | 2018-05-08T08:42:07.000Z | 2022-01-27T14:40:45.000Z | mcycle/constants.py | momargoh/MCycle | 4eed4b80fe041527f9765f9b6ca135fce864ed0f | [
"Apache-2.0"
] | 6 | 2018-05-20T05:52:48.000Z | 2019-09-05T19:56:29.000Z | mcycle/constants.py | momargoh/MCycle | 4eed4b80fe041527f9765f9b6ca135fce864ed0f | [
"Apache-2.0"
] | 4 | 2018-05-06T20:57:34.000Z | 2021-07-03T04:32:15.000Z | # THIS FILE IS AUTOMATICALLY GENERATED: DO NOT EDIT!
# Tolerances
TOLABS_X = 1e-10
# CoolProp input_pairs
INPUT_PAIR_INVALID = 0
QT_INPUTS = 1
PQ_INPUTS = 2
QSmolar_INPUTS = 3
QSmass_INPUTS = 4
HmolarQ_INPUTS = 5
HmassQ_INPUTS = 6
DmolarQ_INPUTS = 7
DmassQ_INPUTS = 8
PT_INPUTS = 9
DmassT_INPUTS = 10
DmolarT_INPUTS = 11... | 20.768519 | 52 | 0.800267 |
7951f8f7c8305aaf71be43c3b809dcf7e5bfd182 | 8,886 | py | Python | broadlink/__init__.py | thewh1teagle/python-broadlink | 6ab23e92614ea89df1fe168a00bcf74d91356ed6 | [
"MIT"
] | 1 | 2020-11-06T01:12:43.000Z | 2020-11-06T01:12:43.000Z | broadlink/__init__.py | thewh1teagle/python-broadlink | 6ab23e92614ea89df1fe168a00bcf74d91356ed6 | [
"MIT"
] | null | null | null | broadlink/__init__.py | thewh1teagle/python-broadlink | 6ab23e92614ea89df1fe168a00bcf74d91356ed6 | [
"MIT"
] | 1 | 2020-11-06T14:45:17.000Z | 2020-11-06T14:45:17.000Z | #!/usr/bin/python3
"""The python-broadlink library."""
import socket
import time
from datetime import datetime
from typing import Dict, List, Union, Tuple, Type
from .alarm import S1C
from .climate import hysen
from .cover import dooya
from .device import device
from .helpers import get_local_ip
from .light import lb1... | 36.719008 | 112 | 0.585415 |
7951fa6331f6d6df56acdbd36acbd540b6636374 | 4,945 | py | Python | Blockchain.py | Sukarnascience/Blockchain_Using_Py | b88dfc316c054ee8407ba2a1e1e3ac68a692ba80 | [
"MIT"
] | 1 | 2021-07-09T02:54:24.000Z | 2021-07-09T02:54:24.000Z | Blockchain.py | Sukarnascience/Blockchain_Using_Py | b88dfc316c054ee8407ba2a1e1e3ac68a692ba80 | [
"MIT"
] | null | null | null | Blockchain.py | Sukarnascience/Blockchain_Using_Py | b88dfc316c054ee8407ba2a1e1e3ac68a692ba80 | [
"MIT"
] | null | null | null | import mysql.connector as sql
from tkinter import *
from tkinter import messagebox
import hashlib
import csv
def block(transaction):
sender = transaction[0]
recever = transaction[1]
ammount = transaction[2]
previous_hash = transaction[3]
new_hash_data = "{},{},{},{}".format(sender,recever,ammount,p... | 34.103448 | 124 | 0.627503 |
7951fa90900749187c175648eca7f72de772b342 | 48 | py | Python | libhoney/version.py | DavidCain/libhoney-py | 3ae150edad4503d6acc4f1c245a02e6761b11ae5 | [
"Apache-2.0"
] | null | null | null | libhoney/version.py | DavidCain/libhoney-py | 3ae150edad4503d6acc4f1c245a02e6761b11ae5 | [
"Apache-2.0"
] | null | null | null | libhoney/version.py | DavidCain/libhoney-py | 3ae150edad4503d6acc4f1c245a02e6761b11ae5 | [
"Apache-2.0"
] | null | null | null | VERSION = "1.11.0" # Update using bump2version
| 24 | 47 | 0.708333 |
7951fb7ddda0d62547c66de1a2a78b7aaddd0965 | 7,179 | py | Python | pandas/tests/scalar/interval/test_interval.py | zhezherun/pandas | 36c1104b7ad9761e020f7e8198eb60da4045d169 | [
"BSD-3-Clause"
] | 1 | 2018-11-11T22:18:13.000Z | 2018-11-11T22:18:13.000Z | pandas/tests/scalar/interval/test_interval.py | zhezherun/pandas | 36c1104b7ad9761e020f7e8198eb60da4045d169 | [
"BSD-3-Clause"
] | null | null | null | pandas/tests/scalar/interval/test_interval.py | zhezherun/pandas | 36c1104b7ad9761e020f7e8198eb60da4045d169 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import division
import numpy as np
from pandas import Interval, Timestamp, Timedelta
import pandas.core.common as com
import pytest
@pytest.fixture
def interval():
return Interval(0, 1)
class TestInterval(object):
def test_properties(self, interval):
assert interval.closed == 'rig... | 31.765487 | 78 | 0.579329 |
7951fd3bdeab71dc53a8f29e08bf0f4419ded088 | 21,742 | py | Python | pytorch/libs/nnet/pooling.py | Angelnatao/asv-subtools | 77d4d940d235b16e9e36a6ee07ce283fa36f4172 | [
"Apache-2.0"
] | 1 | 2020-11-21T08:03:59.000Z | 2020-11-21T08:03:59.000Z | pytorch/libs/nnet/pooling.py | Angelnatao/asv-subtools | 77d4d940d235b16e9e36a6ee07ce283fa36f4172 | [
"Apache-2.0"
] | null | null | null | pytorch/libs/nnet/pooling.py | Angelnatao/asv-subtools | 77d4d940d235b16e9e36a6ee07ce283fa36f4172 | [
"Apache-2.0"
] | null | null | null | # -*- coding:utf-8 -*-
# Copyright xmuspeech (Author: Snowdar 2019-05-29 2020-06-10)
import numpy as np
import torch
import torch.nn.functional as F
from libs.support.utils import to_device
from .components import *
## Pooling ✿
class StatisticsPooling(torch.nn.Module):
""" An usual mean [+ stddev] poolling l... | 42.054159 | 130 | 0.607166 |
7951fe6aa27fc2693f12d9fa775739e5a722e6ce | 1,676 | py | Python | lib/googlecloudsdk/compute/subcommands/instances/get_serial_port_output.py | bopopescu/google-cloud-sdk | b34e6a18f1e89673508166acce816111c3421e4b | [
"Apache-2.0"
] | null | null | null | lib/googlecloudsdk/compute/subcommands/instances/get_serial_port_output.py | bopopescu/google-cloud-sdk | b34e6a18f1e89673508166acce816111c3421e4b | [
"Apache-2.0"
] | null | null | null | lib/googlecloudsdk/compute/subcommands/instances/get_serial_port_output.py | bopopescu/google-cloud-sdk | b34e6a18f1e89673508166acce816111c3421e4b | [
"Apache-2.0"
] | 1 | 2020-07-24T20:04:47.000Z | 2020-07-24T20:04:47.000Z | # Copyright 2014 Google Inc. All Rights Reserved.
"""Command for reading the serial port output of an instance."""
from googlecloudapis.compute.v1 import compute_v1_messages as messages
from googlecloudsdk.calliope import base
from googlecloudsdk.compute.lib import request_helper
from googlecloudsdk.core import log
c... | 33.52 | 73 | 0.672434 |
79520327b096fad38e3a574491bb7615fba5b854 | 2,319 | py | Python | databricks/koalas/tests/test_series_conversion.py | harupy/koalas | db2b00a0d57a16d7ccac101607195d2face73572 | [
"Apache-2.0"
] | 2 | 2020-06-24T03:19:59.000Z | 2020-06-24T03:20:02.000Z | databricks/koalas/tests/test_series_conversion.py | harupy/koalas | db2b00a0d57a16d7ccac101607195d2face73572 | [
"Apache-2.0"
] | null | null | null | databricks/koalas/tests/test_series_conversion.py | harupy/koalas | db2b00a0d57a16d7ccac101607195d2face73572 | [
"Apache-2.0"
] | null | null | null | #
# Copyright (C) 2019 Databricks, Inc.
#
# 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 i... | 39.305085 | 94 | 0.692109 |
795203c86e5cfffbccbb41bacddb3be505884db0 | 104,331 | py | Python | azure/cosmos/cosmos_client.py | nuno-andre/azure-cosmos-python | ea41365b72282823260242ef5dcb3651c4c72ce3 | [
"MIT"
] | null | null | null | azure/cosmos/cosmos_client.py | nuno-andre/azure-cosmos-python | ea41365b72282823260242ef5dcb3651c4c72ce3 | [
"MIT"
] | null | null | null | azure/cosmos/cosmos_client.py | nuno-andre/azure-cosmos-python | ea41365b72282823260242ef5dcb3651c4c72ce3 | [
"MIT"
] | null | null | null | #The MIT License (MIT)
#Copyright (c) 2014 Microsoft Corporation
#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, mod... | 35.498809 | 293 | 0.545044 |
79520480d88a05fb38d18b7816a139e84c110349 | 82,261 | py | Python | tools/wraptypes/yacc.py | AnantTiwari-Naman/pyglet | 4774f2889057da95a78785a69372112931e6a620 | [
"BSD-3-Clause"
] | 1,160 | 2019-06-13T11:51:40.000Z | 2022-03-31T01:55:32.000Z | tools/wraptypes/yacc.py | AnantTiwari-Naman/pyglet | 4774f2889057da95a78785a69372112931e6a620 | [
"BSD-3-Clause"
] | 491 | 2019-07-14T16:13:11.000Z | 2022-03-31T08:04:32.000Z | tools/wraptypes/yacc.py | AnantTiwari-Naman/pyglet | 4774f2889057da95a78785a69372112931e6a620 | [
"BSD-3-Clause"
] | 316 | 2019-06-14T13:56:48.000Z | 2022-03-30T19:26:58.000Z | from __future__ import print_function
#-----------------------------------------------------------------------------
# ply: yacc.py
#
# Author(s): David M. Beazley (dave@dabeaz.com)
# Modifications for pyglet by Alex Holkner (alex.holkner@gmail.com) (<ah>)
#
# Copyright (C) 2001-2006, David M. Beazley
#
# This library ... | 36.6582 | 192 | 0.497465 |
79520499e4c37d51fe5dbc76c69f3a8814269076 | 8,168 | py | Python | helpers/swap_schedule.py | kevindkeogh/qlib.py | a21b08e4a2147025fbd6d64da689c00b4a073196 | [
"MIT"
] | 1 | 2020-08-17T05:28:06.000Z | 2020-08-17T05:28:06.000Z | helpers/swap_schedule.py | kevindkeogh/qlpy | a21b08e4a2147025fbd6d64da689c00b4a073196 | [
"MIT"
] | null | null | null | helpers/swap_schedule.py | kevindkeogh/qlpy | a21b08e4a2147025fbd6d64da689c00b4a073196 | [
"MIT"
] | null | null | null | '''
'''
import dateutil.relativedelta
import numpy as np
class Schedule:
'''Swap fixing, accrual, and payment dates
The Schedule class can be used to generate the details for periods
for swaps.
Arguments:
effective (datetime): effective date of the swap
maturity (datetime): maturity... | 44.63388 | 92 | 0.483105 |
795205f7d6ffb935a725da9d72e08c20092e5543 | 321 | py | Python | markdown_external_link_finder/extract.py | MatMoore/markdown-external-link-finder | bb04d2573e150d8efe61063deafa3119c5f2ef3f | [
"MIT"
] | null | null | null | markdown_external_link_finder/extract.py | MatMoore/markdown-external-link-finder | bb04d2573e150d8efe61063deafa3119c5f2ef3f | [
"MIT"
] | 4 | 2019-06-04T22:36:17.000Z | 2021-06-25T15:34:31.000Z | markdown_external_link_finder/extract.py | MatMoore/markdown-external-link-finder | bb04d2573e150d8efe61063deafa3119c5f2ef3f | [
"MIT"
] | null | null | null | import mistune
from .util import LinkRenderer
def extract_markdown_links(markdown_files):
impl = LinkRenderer()
renderer = mistune.Markdown(renderer=impl)
for markdown_file in markdown_files:
with open(markdown_file) as f:
text = f.read()
renderer(text)
yield from impl.url... | 24.692308 | 46 | 0.694704 |
795206831faef22fcc39baa50c1cf26f43878106 | 4,641 | py | Python | samples/oauth/oauth_on_appengine/appengine_utilities/flash.py | dorosh/gdata-python-client | eb6826ba1e6046a202158d4fefa672150efa0ca5 | [
"Apache-2.0"
] | 2,293 | 2015-01-02T12:46:10.000Z | 2022-03-29T09:45:43.000Z | samples/oauth/oauth_on_appengine/appengine_utilities/flash.py | dorosh/gdata-python-client | eb6826ba1e6046a202158d4fefa672150efa0ca5 | [
"Apache-2.0"
] | 315 | 2015-05-31T11:55:46.000Z | 2022-01-12T08:36:37.000Z | samples/oauth/oauth_on_appengine/appengine_utilities/flash.py | dorosh/gdata-python-client | eb6826ba1e6046a202158d4fefa672150efa0ca5 | [
"Apache-2.0"
] | 1,033 | 2015-01-04T07:48:40.000Z | 2022-03-24T09:34:37.000Z | """
Copyright (c) 2008, appengine-utilities project
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
list of conditions and ... | 38.675 | 82 | 0.653307 |
795206a94949cc474a0065dbbb27278c303d0864 | 6,820 | py | Python | cli/browser.py | windperson/private-docker-registry | 23f2c0d7ecd507486c9979d0e2e9b69a1780839f | [
"Apache-2.0"
] | null | null | null | cli/browser.py | windperson/private-docker-registry | 23f2c0d7ecd507486c9979d0e2e9b69a1780839f | [
"Apache-2.0"
] | null | null | null | cli/browser.py | windperson/private-docker-registry | 23f2c0d7ecd507486c9979d0e2e9b69a1780839f | [
"Apache-2.0"
] | null | null | null | import json
import requests
import sys
''' Disable Warnings when using verify=False'''
'''requests.packages.urllib3.disable_warnings()'''
def get_reqistry_request(url, username=None, password=None, ssl=False):
req = None
if ssl==True:
proto="https://"
else:
proto="http://"
url_endpoint = proto + url
s =... | 27.063492 | 151 | 0.71437 |
795206db4d172f7270f394e8951e6628a0493cf1 | 9,871 | py | Python | hostscripts/rpm-packaging/createproject.py | dirkmueller/automation | a2c3f6ce5c1642d70e46812929f7b18c42d785d7 | [
"Apache-2.0"
] | 61 | 2015-02-01T04:43:09.000Z | 2021-12-10T08:34:02.000Z | hostscripts/rpm-packaging/createproject.py | dirkmueller/automation | a2c3f6ce5c1642d70e46812929f7b18c42d785d7 | [
"Apache-2.0"
] | 2,297 | 2015-01-05T12:23:32.000Z | 2022-03-21T09:23:26.000Z | hostscripts/rpm-packaging/createproject.py | dirkmueller/automation | a2c3f6ce5c1642d70e46812929f7b18c42d785d7 | [
"Apache-2.0"
] | 162 | 2015-01-13T12:30:44.000Z | 2022-02-21T12:12:41.000Z | #!/usr/bin/python3
# vim: sw=4 et
# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your opti... | 31.944984 | 79 | 0.618884 |
7952079764248876b692a1d715776a333831446d | 24,134 | py | Python | Quad_Code_share/Main_Code_Automous.py | EvanHope/SeniorProject | 0980f7187d49988d2d81e34506fa97e7c8cca3a4 | [
"MIT"
] | null | null | null | Quad_Code_share/Main_Code_Automous.py | EvanHope/SeniorProject | 0980f7187d49988d2d81e34506fa97e7c8cca3a4 | [
"MIT"
] | null | null | null | Quad_Code_share/Main_Code_Automous.py | EvanHope/SeniorProject | 0980f7187d49988d2d81e34506fa97e7c8cca3a4 | [
"MIT"
] | 1 | 2021-12-02T21:39:18.000Z | 2021-12-02T21:39:18.000Z | import time
import spidev
import math
import argparse
import sys
import navio.util
#import AccelGyroMag
import navio.mpu9250 # For magnetometer calibration only
import madgwickahrs.madgwickahrs as attitude
import navio.pwm
import navio.adc
import navio.leds
#import GPS
import numpy as np
import navio.ms5611
import os
... | 29.467643 | 314 | 0.662758 |
7952083c0f33e4e80dd5e3eb10385a6f5c5a3e51 | 4,479 | py | Python | lib/BatchNorm.py | bcrafton/ssdfa | 661f9059184fde6ba7ad1ca710c5b5a1954c5ea6 | [
"MIT"
] | 10 | 2019-01-23T17:07:59.000Z | 2021-07-13T10:18:10.000Z | lib/BatchNorm.py | bcrafton/ssdfa | 661f9059184fde6ba7ad1ca710c5b5a1954c5ea6 | [
"MIT"
] | 1 | 2019-07-30T00:55:58.000Z | 2019-09-17T13:31:48.000Z | lib/BatchNorm.py | bcrafton/ssdfa | 661f9059184fde6ba7ad1ca710c5b5a1954c5ea6 | [
"MIT"
] | 1 | 2019-07-28T17:28:30.000Z | 2019-07-28T17:28:30.000Z |
import tensorflow as tf
import numpy as np
import math
from tensorflow.python.ops import gen_nn_ops
from lib.Layer import Layer
class BatchNorm(Layer):
def __init__(self, input_size, name=None, load=None, train=True, eps=1e-3):
self.input_size = list(input_size)
if len(self.input_size) == 2:
... | 34.992188 | 190 | 0.509935 |
79520917eee40acaee7419bedfd4ffadcac052f8 | 11,327 | py | Python | app.py | khanzaifa37/HR_Help | 8c010e8f369028f306b5aa396137c1036af872f6 | [
"MIT"
] | null | null | null | app.py | khanzaifa37/HR_Help | 8c010e8f369028f306b5aa396137c1036af872f6 | [
"MIT"
] | null | null | null | app.py | khanzaifa37/HR_Help | 8c010e8f369028f306b5aa396137c1036af872f6 | [
"MIT"
] | null | null | null | import os, sys, shutil, time
import pickle
from flask import Flask, request, jsonify, render_template,send_from_directory
import pandas as pd
from sklearn.externals import joblib
from sklearn.ensemble import RandomForestClassifier
import numpy as np
import urllib.request
import json
from geopy.geocoders import Nominati... | 29.420779 | 314 | 0.681204 |
795209d2a1286ede6451d2143d46df546a1ec775 | 20,163 | py | Python | du/denv/SshConfigManager.py | spiricn/DevUtils | 58a035a08a7c58035c25f992c1b8aa33cc997cd2 | [
"MIT"
] | 1 | 2021-12-21T13:18:08.000Z | 2021-12-21T13:18:08.000Z | du/denv/SshConfigManager.py | spiricn/DevUtils | 58a035a08a7c58035c25f992c1b8aa33cc997cd2 | [
"MIT"
] | null | null | null | du/denv/SshConfigManager.py | spiricn/DevUtils | 58a035a08a7c58035c25f992c1b8aa33cc997cd2 | [
"MIT"
] | null | null | null | import logging
import re
import os
import sys
from subprocess import CalledProcessError
from du.denv.Command import Command
logger = logging.getLogger(__name__.split(".")[-1])
class SshConfigManager:
"""
Manages ssh configuration files on host and client side for given user
"""
# Path to the scp e... | 40.487952 | 152 | 0.605118 |
79520c495cc5c2afa45dc2248247c7cc96790088 | 4,774 | py | Python | simplesigner/simple_signer.py | Chainfire/simple-signer | 86f85f8c17cc21586e6510d9ad7880bfbdd18761 | [
"MIT"
] | 5 | 2021-03-29T23:12:08.000Z | 2021-12-24T19:44:10.000Z | simplesigner/simple_signer.py | Chainfire/simple-signer | 86f85f8c17cc21586e6510d9ad7880bfbdd18761 | [
"MIT"
] | null | null | null | simplesigner/simple_signer.py | Chainfire/simple-signer | 86f85f8c17cc21586e6510d9ad7880bfbdd18761 | [
"MIT"
] | 2 | 2021-05-08T19:06:24.000Z | 2021-05-20T07:25:27.000Z | from typing import Optional, Any
from .exceptions import *
from .util import KEY_PRIVATE_TYPES, KEY_PUBLIC_TYPES, KEY_ALL_TYPES, is_private_key, is_public_key
class SimpleSigner:
VERSION = 2
MAGIC = 'CFSS'
class SignResult:
def __init__(self, mode: str, bytes_signed: int, signature: str, public_... | 44.616822 | 176 | 0.671764 |
79520c6fd12247ca558a7c69763f901ec63cc9e5 | 59 | py | Python | tests/components/hassio/__init__.py | MrDelik/core | 93a66cc357b226389967668441000498a10453bb | [
"Apache-2.0"
] | 22,481 | 2020-03-02T13:09:59.000Z | 2022-03-31T23:34:28.000Z | tests/components/hassio/__init__.py | MrDelik/core | 93a66cc357b226389967668441000498a10453bb | [
"Apache-2.0"
] | 31,101 | 2020-03-02T13:00:16.000Z | 2022-03-31T23:57:36.000Z | tests/components/hassio/__init__.py | MrDelik/core | 93a66cc357b226389967668441000498a10453bb | [
"Apache-2.0"
] | 11,411 | 2020-03-02T14:19:20.000Z | 2022-03-31T22:46:07.000Z | """Tests for Hass.io component."""
HASSIO_TOKEN = "123456"
| 19.666667 | 34 | 0.694915 |
79520e50dfc18af2b7c16a3b39e287584e628651 | 664 | py | Python | adts/variant.py | jasonsbarr/python-adts | 0bf079062b1356b2a7e6f044afa0a932340aac65 | [
"MIT"
] | null | null | null | adts/variant.py | jasonsbarr/python-adts | 0bf079062b1356b2a7e6f044afa0a932340aac65 | [
"MIT"
] | null | null | null | adts/variant.py | jasonsbarr/python-adts | 0bf079062b1356b2a7e6f044afa0a932340aac65 | [
"MIT"
] | null | null | null | from dataclasses import dataclass, astuple
from typing import TypeVar, Generic
from abc import ABC
T = TypeVar("T")
@dataclass
class Variant(ABC, Generic[T]):
def __new__(cls):
if cls == Variant:
raise TypeError("Cannot instantiate Variant class directly")
return super().__new__(cls)... | 23.714286 | 72 | 0.661145 |
79520e831a30881486726da0d66f1447247b85ab | 49,996 | py | Python | tests/test_playlist.py | EdwardBetts/pyspotify | 851c622e814dee59362d27d978251bd3891c59f7 | [
"Apache-2.0"
] | 2 | 2016-11-18T08:49:26.000Z | 2018-05-14T13:27:19.000Z | tests/test_playlist.py | EdwardBetts/pyspotify | 851c622e814dee59362d27d978251bd3891c59f7 | [
"Apache-2.0"
] | null | null | null | tests/test_playlist.py | EdwardBetts/pyspotify | 851c622e814dee59362d27d978251bd3891c59f7 | [
"Apache-2.0"
] | 1 | 2021-06-24T15:57:12.000Z | 2021-06-24T15:57:12.000Z | # encoding: utf-8
from __future__ import unicode_literals
import collections
import unittest
import spotify
from spotify.playlist import _PlaylistCallbacks
import tests
from tests import mock
@mock.patch('spotify.playlist.lib', spec=spotify.lib)
class PlaylistTest(unittest.TestCase):
def setUp(self):
... | 41.250825 | 79 | 0.696176 |
79520ed9d5f9fcf41be1b6d0afe1d9d86af3e90c | 915 | py | Python | oo/pessoa.py | anthonysilvaa/pythonbirds | 776ef93ffdb3f3365967e87df6cff54020c1d65c | [
"MIT"
] | null | null | null | oo/pessoa.py | anthonysilvaa/pythonbirds | 776ef93ffdb3f3365967e87df6cff54020c1d65c | [
"MIT"
] | null | null | null | oo/pessoa.py | anthonysilvaa/pythonbirds | 776ef93ffdb3f3365967e87df6cff54020c1d65c | [
"MIT"
] | null | null | null | class Pessoa:
olhos = 2
def __init__(self, *filhos, nome: str, idade=35, peso=35):
self.nome = nome
self.idade = idade
self.peso = peso
self.filhos = list(filhos)
def cumprimentar(self):
return f'Olá {id(self)}'
if __name__ == '__main__':
usuario= Pessoa(n... | 20.333333 | 82 | 0.622951 |
79520f2079f590ca21b03e2c73c249d6d57ebac6 | 927 | py | Python | src/zope/app/broken/interfaces.py | zopefoundation/zope.app.broken | 828f59742e424871c53a5760851d7ce5a5c2f6cd | [
"ZPL-2.1"
] | null | null | null | src/zope/app/broken/interfaces.py | zopefoundation/zope.app.broken | 828f59742e424871c53a5760851d7ce5a5c2f6cd | [
"ZPL-2.1"
] | 6 | 2017-05-15T15:58:48.000Z | 2021-05-06T09:00:31.000Z | src/zope/app/broken/interfaces.py | zopefoundation/zope.app.broken | 828f59742e424871c53a5760851d7ce5a5c2f6cd | [
"ZPL-2.1"
] | 1 | 2015-04-03T07:30:37.000Z | 2015-04-03T07:30:37.000Z | ##############################################################################
#
# Copyright (c) 2007 Zope Foundation 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 distribution.
# THIS SOF... | 37.08 | 78 | 0.621359 |
79520f2fb853c72cc43effea739b93bd0a3b20cc | 154 | py | Python | library/string_utils/base64/bench/metrics/main.py | HeyLey/catboost | f472aed90604ebe727537d9d4a37147985e10ec2 | [
"Apache-2.0"
] | 2 | 2019-07-10T10:49:09.000Z | 2020-06-19T11:40:04.000Z | library/string_utils/base64/bench/metrics/main.py | HeyLey/catboost | f472aed90604ebe727537d9d4a37147985e10ec2 | [
"Apache-2.0"
] | 6 | 2020-02-18T22:12:29.000Z | 2020-02-18T22:31:26.000Z | library/string_utils/base64/bench/metrics/main.py | HeyLey/catboost | f472aed90604ebe727537d9d4a37147985e10ec2 | [
"Apache-2.0"
] | 1 | 2018-08-06T14:13:12.000Z | 2018-08-06T14:13:12.000Z | import yatest.common as yc
def test_export_metrics(metrics):
metrics.set_benchmark(yc.execute_benchmark('library/string_utils/base64/bench/bench'))
| 25.666667 | 90 | 0.811688 |
795210398776484f32f8e6c5b9f3a563a744b5ab | 6,671 | py | Python | tests/test_auth_by_token.py | fpga-tom/mod_authnz_jwt | 9e86777b8679df4f5e0b4ef56a77f57d1613e41a | [
"Apache-2.0"
] | 73 | 2016-09-01T00:01:48.000Z | 2022-03-24T03:31:01.000Z | tests/test_auth_by_token.py | fpga-tom/mod_authnz_jwt | 9e86777b8679df4f5e0b4ef56a77f57d1613e41a | [
"Apache-2.0"
] | 48 | 2016-10-27T22:01:58.000Z | 2022-03-07T07:29:00.000Z | tests/test_auth_by_token.py | fpga-tom/mod_authnz_jwt | 9e86777b8679df4f5e0b4ef56a77f57d1613e41a | [
"Apache-2.0"
] | 43 | 2016-10-17T20:53:48.000Z | 2022-03-19T13:15:36.000Z | import time
import unittest
import json
from test_jwt import TestJWT
class TestAuthByToken(TestJWT):
@TestJWT.with_all_algorithms()
def test_login_with_urlencoded_should_success(self, alg, public_key, private_key, secured_url, login_url):
code, content, headers, cookies = self.http_post(login_url, {
... | 57.017094 | 120 | 0.619997 |
79521051960b69ba2f821e42f7642af3cae86b74 | 510 | py | Python | docassemble_webapp/docassemble/webapp/alembic/versions/77e8971ffcbf_first_alembic_revision.py | knod/docassemble | bd052b557743d098138a5f2129a9d3c2f68090a6 | [
"MIT"
] | 568 | 2016-01-08T19:05:06.000Z | 2022-03-30T19:44:47.000Z | docassemble_webapp/docassemble/webapp/alembic/versions/77e8971ffcbf_first_alembic_revision.py | knod/docassemble | bd052b557743d098138a5f2129a9d3c2f68090a6 | [
"MIT"
] | 348 | 2016-01-25T02:17:36.000Z | 2022-03-27T21:22:43.000Z | docassemble_webapp/docassemble/webapp/alembic/versions/77e8971ffcbf_first_alembic_revision.py | knod/docassemble | bd052b557743d098138a5f2129a9d3c2f68090a6 | [
"MIT"
] | 262 | 2016-01-14T23:09:50.000Z | 2022-03-23T15:06:08.000Z | """first alembic revision
Revision ID: 77e8971ffcbf
Revises:
Create Date: 2017-08-13 09:07:33.368044
"""
from alembic import op
import sqlalchemy as sa
from docassemble.webapp.database import dbtableprefix
# revision identifiers, used by Alembic.
revision = '77e8971ffcbf'
down_revision = None
branch_labels = None
d... | 22.173913 | 80 | 0.758824 |
79521082030489af477e06feab63c1d3f5a6065d | 1,307 | py | Python | setup.py | hyperair/flake8-expandtab | bf0f5cbd4398145dd8de6892605de4e297be1c17 | [
"MIT"
] | null | null | null | setup.py | hyperair/flake8-expandtab | bf0f5cbd4398145dd8de6892605de4e297be1c17 | [
"MIT"
] | 1 | 2018-12-17T22:42:38.000Z | 2018-12-18T11:33:40.000Z | setup.py | hyperair/flake8-expandtab | bf0f5cbd4398145dd8de6892605de4e297be1c17 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
from setuptools import setup
def get_long_description():
try:
import pypandoc
return pypandoc.convert("README.md", "rst")
except ImportError:
with open("README.md") as f:
return f.read()
setup(
name='flake8-expandtab',
version='0.3',
des... | 28.413043 | 71 | 0.609028 |
795210e275ea82f35f5b6c1ff50e7f8fc98fe93c | 1,020 | py | Python | tests/job.py | stamp711/DBx1000 | 928912dd7e005ce5a63ad94fdcde412ab893e678 | [
"ISC"
] | null | null | null | tests/job.py | stamp711/DBx1000 | 928912dd7e005ce5a63ad94fdcde412ab893e678 | [
"ISC"
] | null | null | null | tests/job.py | stamp711/DBx1000 | 928912dd7e005ce5a63ad94fdcde412ab893e678 | [
"ISC"
] | null | null | null | workloads = {}
workloads["YCSB+RH"] = {
"WORKLOAD": "YCSB",
"READ_PERC": 0.9,
"WRITE_PERC": 0.1,
}
workloads["YCSB+RW"] = {
"WORKLOAD": "YCSB",
"READ_PERC": 0.5,
"WRITE_PERC": 0.5,
}
workloads["YCSB+WH"] = {
"WORKLOAD": "YCSB",
"READ_PERC": 0.1,
"WRITE_PERC": 0.9,
}
workloads["TPCC... | 29.142857 | 68 | 0.583333 |
795210eeb5512c9005fe9124e88e91470d04acdb | 3,097 | py | Python | ganjoor/spiders/ganjoor.net/roodaki/scrapyrobaeer.py | amirmasoud/ganjoor-crawler | a86fe379955ce854765086ab7ba0a78513d052bd | [
"MIT"
] | null | null | null | ganjoor/spiders/ganjoor.net/roodaki/scrapyrobaeer.py | amirmasoud/ganjoor-crawler | a86fe379955ce854765086ab7ba0a78513d052bd | [
"MIT"
] | null | null | null | ganjoor/spiders/ganjoor.net/roodaki/scrapyrobaeer.py | amirmasoud/ganjoor-crawler | a86fe379955ce854765086ab7ba0a78513d052bd | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import scrapy
class scrapyrobaeerSpider(scrapy.Spider):
name = "scrapyrobaeer"
allowed_domains = ["ganjoor.net"]
if 38 == 1:
start_urls = ["https://ganjoor.net/roodaki/robaeer/sh"]
else:
start_urls = ["https://ganjoor.net/roodaki/robaeer/sh" + "1"]
order = 1
... | 50.770492 | 215 | 0.454634 |
79521104346211d0c8462da6a03bbba73f04ba5d | 2,010 | py | Python | Electronics/ADC.py | KyleKing/Another_Raspberry_Pi_Guide | c1bf871411e8c51df069ba8374fdec49ad43f02b | [
"MIT"
] | 1 | 2016-06-29T14:12:49.000Z | 2016-06-29T14:12:49.000Z | Electronics/ADC.py | KyleKing/Another_Raspberry_Pi_Guide | c1bf871411e8c51df069ba8374fdec49ad43f02b | [
"MIT"
] | 2 | 2016-06-25T16:37:52.000Z | 2016-12-07T02:26:16.000Z | Electronics/ADC.py | KyleKing/Another_Raspberry_Pi_Guide | c1bf871411e8c51df069ba8374fdec49ad43f02b | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# Written by Limor "Ladyada" Fried for Adafruit Industries, (c) 2015
# This code is released into the public domain
# import time
# import os
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM)
DEBUG = 1
# read SPI data from MCP3008 chip, 8 possible adc's (0 thru 7)
def readadc(adcnum, clockpin, m... | 26.8 | 68 | 0.620896 |
795211b2a4b83601f223170208d015ff06a667e3 | 1,500 | py | Python | tests/core/test_local.py | saucynosoy/opta | e96f335d43c849803c1a588a812ee98f52e3f92a | [
"Apache-2.0"
] | null | null | null | tests/core/test_local.py | saucynosoy/opta | e96f335d43c849803c1a588a812ee98f52e3f92a | [
"Apache-2.0"
] | null | null | null | tests/core/test_local.py | saucynosoy/opta | e96f335d43c849803c1a588a812ee98f52e3f92a | [
"Apache-2.0"
] | null | null | null | import json
import os
import unittest
from opta.core.local import Local
from opta.layer import Layer
class LocalTests(unittest.TestCase):
def setUp(self) -> None:
self.layer = Layer(
name="testname",
org_name="testorg",
providers={"local": {"path": "/tmp"}},
... | 31.25 | 81 | 0.592667 |
79521393a95f0c7642754b16fff3f920549ce635 | 3,919 | py | Python | setup.py | bengranett/pypeline | 33aba4dbb9743fb1227f4bfb15f1a97ea22afba4 | [
"MIT"
] | null | null | null | setup.py | bengranett/pypeline | 33aba4dbb9743fb1227f4bfb15f1a97ea22afba4 | [
"MIT"
] | null | null | null | setup.py | bengranett/pypeline | 33aba4dbb9743fb1227f4bfb15f1a97ea22afba4 | [
"MIT"
] | null | null | null | """A setuptools based setup module for catstore.
See:
https://packaging.python.org/en/latest/distributing.html
https://github.com/pypa/sampleproject
"""
# Always prefer setuptools over distutils
from setuptools import setup, find_packages
# To use a consistent encoding
from codecs import open
from os import path
here... | 34.991071 | 96 | 0.667262 |
795213be0b24d02e4040510687ca1f3b419cc048 | 1,841 | py | Python | nova/compute/task_states.py | russellb/nova | 99c2e02b44a1012c8e26fc7658dc40ec4620a1ee | [
"Apache-2.0"
] | 1 | 2015-07-15T08:51:16.000Z | 2015-07-15T08:51:16.000Z | nova/compute/task_states.py | russellb/nova | 99c2e02b44a1012c8e26fc7658dc40ec4620a1ee | [
"Apache-2.0"
] | 1 | 2020-07-24T14:14:13.000Z | 2020-07-24T14:14:13.000Z | nova/compute/task_states.py | russellb/nova | 99c2e02b44a1012c8e26fc7658dc40ec4620a1ee | [
"Apache-2.0"
] | 2 | 2019-06-12T00:52:15.000Z | 2020-07-24T10:35:29.000Z | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 OpenStack LLC.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/... | 30.180328 | 79 | 0.766431 |
795213f23d853b29bbb8529a9ac176c93d7888d1 | 2,605 | py | Python | 2-9-1.py | WAETW/aima_exercise | 63c7e8c4f0e995cd57c6540aa895598b97ade709 | [
"MIT"
] | null | null | null | 2-9-1.py | WAETW/aima_exercise | 63c7e8c4f0e995cd57c6540aa895598b97ade709 | [
"MIT"
] | null | null | null | 2-9-1.py | WAETW/aima_exercise | 63c7e8c4f0e995cd57c6540aa895598b97ade709 | [
"MIT"
] | null | null | null | import random
import sys
'''初始化環境'''
def dirt_placing():
loc_A = random.choice(['Clean', 'Dirty'])
loc_B = random.choice(['Clean', 'Dirty'])
return loc_A,loc_B
'''agent初始位置'''
def init_loc():
vacuum_init_loc = random.choice(['loc_A','loc_B'])
return vacuum_init_loc
'''計算分數,agent往左往右扣一分,吸則... | 31.768293 | 74 | 0.575816 |
7952147a024e5fdf6e83507b6ebd939c1e81db31 | 21,023 | py | Python | huskies-worker-optimize/run.py | dajinchu/battlecode18 | 688f845b06867b23d60cdeddb6ccb8d0b2e0620a | [
"MIT"
] | null | null | null | huskies-worker-optimize/run.py | dajinchu/battlecode18 | 688f845b06867b23d60cdeddb6ccb8d0b2e0620a | [
"MIT"
] | null | null | null | huskies-worker-optimize/run.py | dajinchu/battlecode18 | 688f845b06867b23d60cdeddb6ccb8d0b2e0620a | [
"MIT"
] | null | null | null | import battlecode as bc
import random
import sys
import traceback
import collections as fast
import time
import math
print("pystarting")
# A GameController is the main type that you talk to the game with.
# Its constructor will connect to a running game.
gc = bc.GameController()
print("pystarted")
# It's a good ide... | 36.882456 | 148 | 0.615754 |
795214ac1b0f6c954937dce3570a81e56050b498 | 2,424 | py | Python | aliyun-python-sdk-adb/aliyunsdkadb/request/v20190315/ModifyAuditLogConfigRequest.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-adb/aliyunsdkadb/request/v20190315/ModifyAuditLogConfigRequest.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-adb/aliyunsdkadb/request/v20190315/ModifyAuditLogConfigRequest.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... | 35.647059 | 79 | 0.775578 |
795214fd3ec7d8c8571e0714c2a1aab5aa52d3c8 | 6,096 | py | Python | workspace/models/train_classifier.py | s-arora-1987/Disaster-Response-App | 2c2a74bea481d4c52520b35d92f9344d63528ee3 | [
"MIT"
] | null | null | null | workspace/models/train_classifier.py | s-arora-1987/Disaster-Response-App | 2c2a74bea481d4c52520b35d92f9344d63528ee3 | [
"MIT"
] | null | null | null | workspace/models/train_classifier.py | s-arora-1987/Disaster-Response-App | 2c2a74bea481d4c52520b35d92f9344d63528ee3 | [
"MIT"
] | null | null | null | import sys
import pandas as pd
from sqlalchemy import create_engine
import time
import pickle
# for tokenizing
import nltk
nltk.download(['punkt', 'wordnet'])
import re
from nltk.tokenize import word_tokenize
from nltk.stem import WordNetLemmatizer
url_regex = 'http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*\(\),]|(?:%[0-9... | 36.285714 | 92 | 0.605479 |
7952153ee706807605f76c0c40838fa537f241c2 | 477 | py | Python | Test_TagParser.py | whaleygeek/pyparsers | 41e6e5c807959ff18c2f625f3d9b67e669132390 | [
"MIT"
] | null | null | null | Test_TagParser.py | whaleygeek/pyparsers | 41e6e5c807959ff18c2f625f3d9b67e669132390 | [
"MIT"
] | null | null | null | Test_TagParser.py | whaleygeek/pyparsers | 41e6e5c807959ff18c2f625f3d9b67e669132390 | [
"MIT"
] | 1 | 2020-07-23T14:41:12.000Z | 2020-07-23T14:41:12.000Z | # Test_TagParser.py (c) 2014 D.J.Whale
#
# A TagParser is a helper for SAXP (Simple Api For XML Processing)
# that makes it much easier to use for beginners.
# Just call the parse() method to parse a file.
#
# See other test and demo programs in this folder to find out
# how to actually process data using a TagParser... | 23.85 | 66 | 0.731656 |
79521580a244cc266d7f33807bf1aa6d35cb3070 | 10,651 | py | Python | ndm/model_cnn12_bn_w2targs.py | oplatek/ndm | d32bd9d685902d9da52b7e7abd286fb5d9c7274a | [
"Apache-2.0"
] | 2 | 2016-01-26T15:29:30.000Z | 2016-12-07T23:36:23.000Z | ndm/model_cnn12_bn_w2targs.py | oplatek/ndm | d32bd9d685902d9da52b7e7abd286fb5d9c7274a | [
"Apache-2.0"
] | 1 | 2018-05-10T08:03:32.000Z | 2018-05-10T08:03:32.000Z | ndm/model_cnn12_bn_w2targs.py | oplatek/ndm | d32bd9d685902d9da52b7e7abd286fb5d9c7274a | [
"Apache-2.0"
] | 1 | 2016-02-25T14:35:47.000Z | 2016-02-25T14:35:47.000Z | #!/usr/bin/env python3
import tensorflow as tf
from tfx.bricks import embedding, dense_to_one_hot, linear, dropout, reduce_max, batch_norm_lin, conv2d_bn, \
pow_1, softmax_2d
from model import ModelW2TArgs
class Model(ModelW2TArgs):
def __init__(self, data, FLAGS):
super(Model, self).__init__(data,... | 46.714912 | 140 | 0.579007 |
795216003cde59d0016ce71e1c30b2cc72b7e0e2 | 1,404 | py | Python | poretools/fasta.py | orivej/poretools | 567e8cd99aa5112bc77f7ee8ebdd3bfbfa142a09 | [
"MIT"
] | null | null | null | poretools/fasta.py | orivej/poretools | 567e8cd99aa5112bc77f7ee8ebdd3bfbfa142a09 | [
"MIT"
] | null | null | null | poretools/fasta.py | orivej/poretools | 567e8cd99aa5112bc77f7ee8ebdd3bfbfa142a09 | [
"MIT"
] | null | null | null | import Fast5File
import sys
def run(parser, args):
for fast5 in Fast5File.Fast5FileSet(args.files, args.group, args.basecaller_name):
if args.start_time or args.end_time:
read_start_time = fast5.get_start_time()
read_end_time = fast5.get_end_time()
if args.start_time and args.start_time > read_start_time... | 28.653061 | 83 | 0.708689 |
79521738195a4d45f5ab5cefe43ea3797d2ac9eb | 17,636 | py | Python | src/SettingsWidget.py | Essyer/PoETiS | 94560dcb2de6bb87523ed7ec08c5dffcba136315 | [
"MIT"
] | 22 | 2020-06-13T14:08:31.000Z | 2022-01-02T10:52:56.000Z | src/SettingsWidget.py | Essyer/PoETiS | 94560dcb2de6bb87523ed7ec08c5dffcba136315 | [
"MIT"
] | 9 | 2020-06-14T09:21:12.000Z | 2022-02-14T07:44:32.000Z | src/SettingsWidget.py | Essyer/PoETiS | 94560dcb2de6bb87523ed7ec08c5dffcba136315 | [
"MIT"
] | 6 | 2020-06-13T17:03:16.000Z | 2022-02-12T10:09:01.000Z | import os
import xml.etree.ElementTree as ElementTree
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
from src.PainterWidget import PainterWidget
from src.DragWidget import DragWidget
from src.Slider import Slider
from src.utils import log_method_name, prepare_cfg, load_styles, defaul... | 44.761421 | 120 | 0.668009 |
79521858b55aa4286dd34289236842bf4db7125b | 392 | py | Python | espnApi/wsgi.py | thexdesk/ESPN-API | debaf328d385c688f90dbb96703244f87da3c100 | [
"MIT"
] | null | null | null | espnApi/wsgi.py | thexdesk/ESPN-API | debaf328d385c688f90dbb96703244f87da3c100 | [
"MIT"
] | 3 | 2020-06-05T17:12:59.000Z | 2021-06-10T18:09:18.000Z | espnApi/wsgi.py | thexdesk/ESPN-API | debaf328d385c688f90dbb96703244f87da3c100 | [
"MIT"
] | 1 | 2020-02-09T08:17:18.000Z | 2020-02-09T08:17:18.000Z | """
WSGI config for espnApi project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETT... | 23.058824 | 78 | 0.785714 |
79521861e9154a4b637c14aaedcd2a85bfae066d | 6,834 | py | Python | muddery/worlddata/editor/form_view.py | noahzaozao/muddery | 294da6fb73cb04c62e5ba6eefe49b595ca76832a | [
"BSD-3-Clause"
] | null | null | null | muddery/worlddata/editor/form_view.py | noahzaozao/muddery | 294da6fb73cb04c62e5ba6eefe49b595ca76832a | [
"BSD-3-Clause"
] | null | null | null | muddery/worlddata/editor/form_view.py | noahzaozao/muddery | 294da6fb73cb04c62e5ba6eefe49b595ca76832a | [
"BSD-3-Clause"
] | null | null | null |
"""
This file checks user's edit actions and put changes into db.
"""
from django import http
from django.shortcuts import render
from django.http import HttpResponseRedirect
from django.conf import settings
from evennia.utils import logger
from muddery.utils.exception import MudderyError
from worlddata import forms
... | 25.984791 | 107 | 0.530436 |
79521937d550d38bcbb25bfdfcfbad0eca232ff5 | 47 | py | Python | exercicio9.py | llucaslopes/infosatc-lp-avaliativo-02 | 91708c7ec519bbde591ccd713002f80d37ec77c5 | [
"MIT"
] | null | null | null | exercicio9.py | llucaslopes/infosatc-lp-avaliativo-02 | 91708c7ec519bbde591ccd713002f80d37ec77c5 | [
"MIT"
] | null | null | null | exercicio9.py | llucaslopes/infosatc-lp-avaliativo-02 | 91708c7ec519bbde591ccd713002f80d37ec77c5 | [
"MIT"
] | null | null | null | lista = [9,2,3,4,7,10,66]
print(sorted(lista)) | 15.666667 | 25 | 0.638298 |
795219e1ad630d9943a74dae1b73450301411b15 | 607 | py | Python | examples/ColorExample.py | melopero/Melopero_APDS-9960 | 9006454704abb7bea47435b58448133dc888d34f | [
"MIT"
] | null | null | null | examples/ColorExample.py | melopero/Melopero_APDS-9960 | 9006454704abb7bea47435b58448133dc888d34f | [
"MIT"
] | null | null | null | examples/ColorExample.py | melopero/Melopero_APDS-9960 | 9006454704abb7bea47435b58448133dc888d34f | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
@author: Leonardo La Rocca
"""
import time
import melopero_apds9960 as mp
def main():
device = mp.APDS_9960()
device.reset()
device.enable_als_engine()
device.set_als_integration_time(450)
saturation = device.get_saturation()
device.wake_up(... | 20.931034 | 100 | 0.62603 |
79521ada66eaa6fade9aac51bed690b64154e3dc | 4,387 | py | Python | source/libLinear.py | networkdynamics/attribution-extraction | 5f4420769ea74f1c358ff8a2423fa8ca9083b4fc | [
"MIT"
] | 3 | 2018-03-08T21:38:42.000Z | 2020-05-01T14:14:22.000Z | source/libLinear.py | networkdynamics/attribution-extraction | 5f4420769ea74f1c358ff8a2423fa8ca9083b4fc | [
"MIT"
] | null | null | null | source/libLinear.py | networkdynamics/attribution-extraction | 5f4420769ea74f1c358ff8a2423fa8ca9083b4fc | [
"MIT"
] | null | null | null | import numpy as np
import pandas as pd
import os
from sklearn import linear_model
from sklearn.cross_validation import train_test_split
from time import time
from sklearn.metrics import classification_report
from sklearn.metrics import confusion_matrix
import operator
from sklearn.externals import joblib
import sys
d... | 26.75 | 552 | 0.731707 |
79521aee37539c48a19e90939a05815c894b46e4 | 270 | py | Python | ExamBankSpider/ExamBankSpider/items.py | Cary123/ExamSimulation | 2d3f475457fed817063f7ab1c2b347a2dd2f0b07 | [
"MIT"
] | null | null | null | ExamBankSpider/ExamBankSpider/items.py | Cary123/ExamSimulation | 2d3f475457fed817063f7ab1c2b347a2dd2f0b07 | [
"MIT"
] | null | null | null | ExamBankSpider/ExamBankSpider/items.py | Cary123/ExamSimulation | 2d3f475457fed817063f7ab1c2b347a2dd2f0b07 | [
"MIT"
] | null | null | null | # Define here the models for your scraped items
#
# See documentation in:
# https://docs.scrapy.org/en/latest/topics/items.html
import scrapy
class ExambankspiderItem(scrapy.Item):
# define the fields for your item here like:
# name = scrapy.Field()
pass
| 20.769231 | 53 | 0.722222 |
79521b2f6ec460168c86a05be6eef2befb906eae | 1,284 | py | Python | sandbox/compare_hypnograms_second_rater.py | skjerns/NT1-HRV | cb6de312f6b2710c4d059bb2a4638b053617c2f7 | [
"MIT"
] | 1 | 2022-03-06T03:32:15.000Z | 2022-03-06T03:32:15.000Z | sandbox/compare_hypnograms_second_rater.py | skjerns/NT1-HRV | cb6de312f6b2710c4d059bb2a4638b053617c2f7 | [
"MIT"
] | null | null | null | sandbox/compare_hypnograms_second_rater.py | skjerns/NT1-HRV | cb6de312f6b2710c4d059bb2a4638b053617c2f7 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Wed Apr 1 14:48:42 2020
@author: skjerns
"""
import config as cfg
import ospath
import shutil
import sleep_utils
import numpy as np
from sklearn.metrics import cohen_kappa_score
import matplotlib.pyplot as plt
files = ospath.list_files(cfg.folder_edf, exts=['hypno'])
accuracy... | 27.913043 | 102 | 0.623832 |
79521b3e91a75839a6404eae8d5077983c23d7e9 | 152 | py | Python | packages/core/minos-microservice-common/minos/common/injections/__init__.py | bhardwajRahul/minos-python | bad7a280ad92680abdeab01d1214688279cf6316 | [
"MIT"
] | 247 | 2022-01-24T14:55:30.000Z | 2022-03-25T12:06:17.000Z | packages/core/minos-microservice-common/minos/common/injections/__init__.py | bhardwajRahul/minos-python | bad7a280ad92680abdeab01d1214688279cf6316 | [
"MIT"
] | 168 | 2022-01-24T14:54:31.000Z | 2022-03-31T09:31:09.000Z | packages/core/minos-microservice-common/minos/common/injections/__init__.py | bhardwajRahul/minos-python | bad7a280ad92680abdeab01d1214688279cf6316 | [
"MIT"
] | 21 | 2022-02-06T17:25:58.000Z | 2022-03-27T04:50:29.000Z | from .decorators import (
Inject,
Injectable,
)
from .injectors import (
DependencyInjector,
)
from .mixins import (
InjectableMixin,
)
| 13.818182 | 25 | 0.684211 |
79521be3865602edec02b7c9f4447ca2d6e364e4 | 686 | py | Python | app/core/migrations/0003_ingredient.py | aadnekar/recipe-app-api | c1c524a7dbd3fb73e00e90effc455c3fc66155fe | [
"MIT"
] | null | null | null | app/core/migrations/0003_ingredient.py | aadnekar/recipe-app-api | c1c524a7dbd3fb73e00e90effc455c3fc66155fe | [
"MIT"
] | null | null | null | app/core/migrations/0003_ingredient.py | aadnekar/recipe-app-api | c1c524a7dbd3fb73e00e90effc455c3fc66155fe | [
"MIT"
] | null | null | null | # Generated by Django 2.1.15 on 2019-12-30 00:23
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('core', '0002_tag'),
]
operations = [
migrations.CreateModel(
... | 28.583333 | 118 | 0.618076 |
79521c64a3cca8100e056ee252d71787844a41f0 | 1,458 | py | Python | src/perf/data_pipe_perf/py_curio_queue_perf.py | random-python/data_pipe | e64fbbdb04f9cd43f7f3e58688c4ac1e2c2bbb45 | [
"Apache-2.0"
] | 14 | 2020-02-08T06:27:09.000Z | 2021-06-02T07:35:09.000Z | src/perf/data_pipe_perf/py_curio_queue_perf.py | random-python/data_pipe | e64fbbdb04f9cd43f7f3e58688c4ac1e2c2bbb45 | [
"Apache-2.0"
] | null | null | null | src/perf/data_pipe_perf/py_curio_queue_perf.py | random-python/data_pipe | e64fbbdb04f9cd43f7f3e58688c4ac1e2c2bbb45 | [
"Apache-2.0"
] | null | null | null | """
"""
import gc
import time
import curio
count = int(1e5) # number of objects to transfer
async def buffer_perf():
gc.collect() # start with clean memory
source = [index for index in range(count)] # pre-allocate data source
target = [None for index in range(count)] # pre-allocate data target
... | 25.137931 | 85 | 0.616598 |
79521cc5e4138c18652fe17a25095056ea6ce387 | 2,025 | py | Python | platformio/builder/scripts/frameworks/energia.py | eiginn/platformio | 33502f82f26e731f5bdc38c1ea6b17d1565dedd3 | [
"Apache-2.0"
] | null | null | null | platformio/builder/scripts/frameworks/energia.py | eiginn/platformio | 33502f82f26e731f5bdc38c1ea6b17d1565dedd3 | [
"Apache-2.0"
] | null | null | null | platformio/builder/scripts/frameworks/energia.py | eiginn/platformio | 33502f82f26e731f5bdc38c1ea6b17d1565dedd3 | [
"Apache-2.0"
] | null | null | null | # Copyright 2014-2016 Ivan Kravets <me@ikravets.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 27 | 79 | 0.700741 |
79521e2c42f18ed882ceaf860c93f1b40b871469 | 10,746 | py | Python | pyscf/cc/gccsd_rdm.py | azag0/pyscf | 1e3e27b61b3cfd22c9679d2c9851c13b3ebc5a1b | [
"Apache-2.0"
] | null | null | null | pyscf/cc/gccsd_rdm.py | azag0/pyscf | 1e3e27b61b3cfd22c9679d2c9851c13b3ebc5a1b | [
"Apache-2.0"
] | null | null | null | pyscf/cc/gccsd_rdm.py | azag0/pyscf | 1e3e27b61b3cfd22c9679d2c9851c13b3ebc5a1b | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# Copyright 2014-2020 The PySCF Developers. 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
#
# U... | 36.181818 | 89 | 0.605807 |
79521f077daf92d426584dd12f539ddb5231bf52 | 42,493 | py | Python | pycqed/instrument_drivers/physical_instruments/ZurichInstruments/ZI_HDAWG8.py | ZW7436/PycQED_py3 | dcc19dbaedd226112a2f98a7985dcf2bab2c9734 | [
"MIT"
] | 1 | 2019-07-05T13:41:51.000Z | 2019-07-05T13:41:51.000Z | pycqed/instrument_drivers/physical_instruments/ZurichInstruments/ZI_HDAWG8.py | ball199578/PycQED_py3 | dcc19dbaedd226112a2f98a7985dcf2bab2c9734 | [
"MIT"
] | null | null | null | pycqed/instrument_drivers/physical_instruments/ZurichInstruments/ZI_HDAWG8.py | ball199578/PycQED_py3 | dcc19dbaedd226112a2f98a7985dcf2bab2c9734 | [
"MIT"
] | null | null | null | import time
import logging
import os
import numpy as np
from . import zishell_NH as zs
from qcodes.utils import validators as vals
from .ZI_base_instrument import ZI_base_instrument
from qcodes.instrument.parameter import ManualParameter
from zlib import crc32
import ctypes
from ctypes.wintypes import MAX_PATH
class... | 41.98913 | 138 | 0.528911 |
79521fcbfb967e650cb7e2059d63cc45c8045a9e | 1,202 | py | Python | config.py | marcdjulien/govindex | 18740206e54aecfb4193e910e5076ee504229779 | [
"MIT"
] | null | null | null | config.py | marcdjulien/govindex | 18740206e54aecfb4193e910e5076ee504229779 | [
"MIT"
] | null | null | null | config.py | marcdjulien/govindex | 18740206e54aecfb4193e910e5076ee504229779 | [
"MIT"
] | null | null | null | # -*- encoding: utf-8 -*-
"""
Copyright (c) 2019 - present AppSeed.us
"""
import os
from decouple import config
class Config(object):
basedir = os.path.abspath(os.path.dirname(__file__))
SECRET_KEY = config('SECRET_KEY', default='sdnfogui3wn')
SQLALCHEMY_DATABASE_URI = config('SQLALCHEMY_DATABASE_URI',... | 28.619048 | 94 | 0.633943 |
79521fcd997a54511714792481bb583f27065d3a | 4,103 | py | Python | grr/server/grr_response_server/rdfvalues/hunts.py | billstackpole/grr | 203a0a99990a2d4004aed84a5cd822cbda2b418c | [
"Apache-2.0"
] | 1 | 2019-03-28T07:09:41.000Z | 2019-03-28T07:09:41.000Z | grr/server/grr_response_server/rdfvalues/hunts.py | gingogo/grr | 203a0a99990a2d4004aed84a5cd822cbda2b418c | [
"Apache-2.0"
] | null | null | null | grr/server/grr_response_server/rdfvalues/hunts.py | gingogo/grr | 203a0a99990a2d4004aed84a5cd822cbda2b418c | [
"Apache-2.0"
] | 1 | 2018-08-30T14:50:24.000Z | 2018-08-30T14:50:24.000Z | #!/usr/bin/env python
"""RDFValue implementations for hunts."""
from grr_response_core import config
from grr_response_core.lib import rdfvalue
from grr_response_core.lib import registry
from grr_response_core.lib.rdfvalues import client as rdf_client
from grr_response_core.lib.rdfvalues import client_stats as rdf_cli... | 31.083333 | 76 | 0.763344 |
79521fd588437a1051879e55297993fc552cd60a | 7,143 | py | Python | checkout/views.py | lucaslamounier/django-ecommerce | c988909f0e1eb7e8de533fde141c14947de116fe | [
"CC0-1.0"
] | null | null | null | checkout/views.py | lucaslamounier/django-ecommerce | c988909f0e1eb7e8de533fde141c14947de116fe | [
"CC0-1.0"
] | null | null | null | checkout/views.py | lucaslamounier/django-ecommerce | c988909f0e1eb7e8de533fde141c14947de116fe | [
"CC0-1.0"
] | null | null | null | # coding=utf-8
import logging
import json
from pagseguro import PagSeguro
from paypal.standard.forms import PayPalPaymentsForm
from paypal.standard.models import ST_PP_COMPLETED
from paypal.standard.ipn.signals import valid_ipn_received
from django.views.decorators.csrf import csrf_exempt
from django.shortcuts import... | 33.535211 | 82 | 0.667087 |
7952201b41df41d08ba357edeaf6269d29692f02 | 4,637 | py | Python | demo/python/rhino_demo_file.py | hellow554/rhino | bbea49a0671841e4577902c4455904572b49612f | [
"Apache-2.0"
] | 472 | 2018-10-29T16:51:52.000Z | 2022-03-29T05:45:29.000Z | demo/python/rhino_demo_file.py | hellow554/rhino | bbea49a0671841e4577902c4455904572b49612f | [
"Apache-2.0"
] | 89 | 2018-12-24T04:13:56.000Z | 2022-03-25T17:18:07.000Z | demo/python/rhino_demo_file.py | hellow554/rhino | bbea49a0671841e4577902c4455904572b49612f | [
"Apache-2.0"
] | 70 | 2018-11-03T02:39:11.000Z | 2022-03-17T00:05:38.000Z | #
# Copyright 2018-2021 Picovoice Inc.
#
# You may not use this file except in compliance with the license. A copy of the license is located in the "LICENSE"
# file accompanying this source.
#
# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
# an "AS ... | 35.669231 | 119 | 0.64848 |
795221a12826c986c883c95a2eec38675fca1169 | 948 | py | Python | iaso/utils/models/soft_deletable.py | ekhalilbsq/iaso | e6400c52aeb4f67ce1ca83b03efa3cb11ef235ee | [
"MIT"
] | 29 | 2020-12-26T07:22:19.000Z | 2022-03-07T13:40:09.000Z | iaso/utils/models/soft_deletable.py | ekhalilbsq/iaso | e6400c52aeb4f67ce1ca83b03efa3cb11ef235ee | [
"MIT"
] | 150 | 2020-11-09T15:03:27.000Z | 2022-03-07T15:36:07.000Z | iaso/utils/models/soft_deletable.py | ekhalilbsq/iaso | e6400c52aeb4f67ce1ca83b03efa3cb11ef235ee | [
"MIT"
] | 4 | 2020-11-09T10:38:13.000Z | 2021-10-04T09:42:47.000Z | from django.db import models
from django.db.models.functions import Now
class DefaultSoftDeletableManager(models.Manager):
def get_queryset(self):
return super().get_queryset().filter(deleted_at=None)
class IncludeDeletedSoftDeletableManager(models.Manager):
def get_queryset(self):
return su... | 26.333333 | 74 | 0.712025 |
7952222427b78b6a8fc84cf31d52ce6d433b0f22 | 288 | py | Python | PacoteDownload/Mundo 3 do curso Parte 2/numeros.py | Gabriel-ER/CursoEmVideodoYoutube-Python- | 0733ce05f28f8f87603270ef5ab7cb51c8f2c5ac | [
"MIT"
] | null | null | null | PacoteDownload/Mundo 3 do curso Parte 2/numeros.py | Gabriel-ER/CursoEmVideodoYoutube-Python- | 0733ce05f28f8f87603270ef5ab7cb51c8f2c5ac | [
"MIT"
] | null | null | null | PacoteDownload/Mundo 3 do curso Parte 2/numeros.py | Gabriel-ER/CursoEmVideodoYoutube-Python- | 0733ce05f28f8f87603270ef5ab7cb51c8f2c5ac | [
"MIT"
] | null | null | null | import uteis #O meu módulo uteis está na minha pasta
'''
Todo arquivo python é considerado um módulo
Toda pasta é considerada um pacote
Sintaxe especiais para pacotes
'''
num = int(input('Número: '))
print(f'O fatorial de {num} é {uteis.fatorial(num)} e o dobro é {uteis.dobro(num)}.')
| 26.181818 | 85 | 0.729167 |
79522315f193b903ef3bbd29728cc41d8fe3599d | 16,936 | py | Python | cloningR.py | yketa/active_work | 99107a0d4935296b673f67469c1e2bd258954b9b | [
"MIT"
] | 1 | 2022-01-19T14:24:46.000Z | 2022-01-19T14:24:46.000Z | cloningR.py | yketa/active_work | 99107a0d4935296b673f67469c1e2bd258954b9b | [
"MIT"
] | null | null | null | cloningR.py | yketa/active_work | 99107a0d4935296b673f67469c1e2bd258954b9b | [
"MIT"
] | 1 | 2021-02-09T16:36:15.000Z | 2021-02-09T16:36:15.000Z | """
Module cloningR launches cloning simulations of rotors and provides classes to
read output data files from these simulations.
Bias is chosen with environment variable `CLONING_BIAS':
(0) order parameter,
(1) squared order parameter.
(see https://yketa.github.io/DAMTP_MSC_2019_Wiki/#Brownian%20rotors%20clon... | 42.34 | 146 | 0.57676 |
79522389fec074014b75e90887d3a346720ca616 | 8,639 | py | Python | open-hackathon-server/src/hackathon/hack/azure_cert_manager.py | pcwl/open-hackathon | cbd0afbbf0b4047af17086a0d9c0a9c031bd3595 | [
"MIT"
] | null | null | null | open-hackathon-server/src/hackathon/hack/azure_cert_manager.py | pcwl/open-hackathon | cbd0afbbf0b4047af17086a0d9c0a9c031bd3595 | [
"MIT"
] | null | null | null | open-hackathon-server/src/hackathon/hack/azure_cert_manager.py | pcwl/open-hackathon | cbd0afbbf0b4047af17086a0d9c0a9c031bd3595 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
This file is covered by the LICENSING file in the root of this project.
"""
import sys
sys.path.append('..')
import os
from os.path import dirname, realpath, abspath, isfile
import commands
from hackathon.hazure.cloud_service_adapter import CloudServiceAdapter
from hackathon.hmongo.model... | 35.405738 | 141 | 0.639079 |
795223919443326b228d8bfb883162b8a1c06e84 | 23,553 | py | Python | python/ray/tune/syncer.py | andenrx/ray | 0ad4113e22aa4ec40f87d4a16e474a452f9c8af7 | [
"Apache-2.0"
] | null | null | null | python/ray/tune/syncer.py | andenrx/ray | 0ad4113e22aa4ec40f87d4a16e474a452f9c8af7 | [
"Apache-2.0"
] | null | null | null | python/ray/tune/syncer.py | andenrx/ray | 0ad4113e22aa4ec40f87d4a16e474a452f9c8af7 | [
"Apache-2.0"
] | null | null | null | from typing import Any, Callable, Dict, List, TYPE_CHECKING, Type, Union, Optional
import distutils
import logging
import os
import time
from dataclasses import dataclass
import warnings
from inspect import isclass
from shlex import quote
import ray
import yaml
from ray.tune import TuneError
from ray.tune.callback i... | 36.179724 | 88 | 0.627691 |
795224271191eb5321529833cfb1cc0dba6aa105 | 557 | py | Python | src/parse_md.py | peter88213/yw2md | 0a8ffa4ac9aed4d7e7abb0b22ac41fcbde86ccd1 | [
"MIT"
] | null | null | null | src/parse_md.py | peter88213/yw2md | 0a8ffa4ac9aed4d7e7abb0b22ac41fcbde86ccd1 | [
"MIT"
] | null | null | null | src/parse_md.py | peter88213/yw2md | 0a8ffa4ac9aed4d7e7abb0b22ac41fcbde86ccd1 | [
"MIT"
] | null | null | null | """Save the result of Markdown-to-yWriter conversion
Just an auxiliary script for development,
to see the result of MdFile.convert_to_yw.
"""
from md_yw import MdFile
import sys
if __name__ == '__main__':
sourceFile = sys.argv[1]
with open(sourceFile, encoding='utf-8') as f:
mdText = f.... | 24.217391 | 54 | 0.621185 |
795224f070a6535185cfa557cb11a443eccda961 | 1,459 | py | Python | indra/tools/live_curation/util.py | djinnome/indra | 382b7f236e0b1422c96a268ef873530b5e92d48f | [
"BSD-2-Clause"
] | null | null | null | indra/tools/live_curation/util.py | djinnome/indra | 382b7f236e0b1422c96a268ef873530b5e92d48f | [
"BSD-2-Clause"
] | null | null | null | indra/tools/live_curation/util.py | djinnome/indra | 382b7f236e0b1422c96a268ef873530b5e92d48f | [
"BSD-2-Clause"
] | null | null | null | import json
import logging
from indra.statements import Statement
logger = logging.getLogger(__name__)
def _json_loader(fpath):
logger.info('Loading json file %s' % fpath)
with open(fpath, 'r') as f:
return json.load(f)
def _json_dumper(jsonobj, fpath):
try:
logger.info('Saving json obj... | 23.918033 | 69 | 0.638108 |
7952285817860c2caf36ae8c14a47dc5b74e783b | 27,023 | py | Python | sdk/python/pulumi_aws/ec2/volume_attachment.py | rapzo/pulumi-aws | 390a098221315d98a54ba97d1559e750dc3053b7 | [
"ECL-2.0",
"Apache-2.0"
] | 260 | 2018-06-18T14:57:00.000Z | 2022-03-29T11:41:03.000Z | sdk/python/pulumi_aws/ec2/volume_attachment.py | rapzo/pulumi-aws | 390a098221315d98a54ba97d1559e750dc3053b7 | [
"ECL-2.0",
"Apache-2.0"
] | 1,154 | 2018-06-19T20:38:20.000Z | 2022-03-31T19:48:16.000Z | sdk/python/pulumi_aws/ec2/volume_attachment.py | rapzo/pulumi-aws | 390a098221315d98a54ba97d1559e750dc3053b7 | [
"ECL-2.0",
"Apache-2.0"
] | 115 | 2018-06-28T03:20:27.000Z | 2022-03-29T11:41:06.000Z | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import... | 52.067437 | 382 | 0.667913 |
79522904f8f6e4268e91e7b9a8ad17fb96273750 | 3,241 | py | Python | test/functional/wallet_create_tx.py | bvbfan/ain | 71e3b3456f90a858d1325f612bd44393789d74d2 | [
"MIT"
] | null | null | null | test/functional/wallet_create_tx.py | bvbfan/ain | 71e3b3456f90a858d1325f612bd44393789d74d2 | [
"MIT"
] | null | null | null | test/functional/wallet_create_tx.py | bvbfan/ain | 71e3b3456f90a858d1325f612bd44393789d74d2 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2018-2019 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from test_framework.test_framework import DefiTestFramework
from test_framework.util import (
assert_... | 39.048193 | 100 | 0.650108 |
795229277f998b8ce46733de9c5726d940c18fc1 | 641 | py | Python | acrobot.py | patrick-kidger/FasterNeuralDiffEq | 510ca2aa3f9864d0190640d8d8c37b3f208cdfc9 | [
"Apache-2.0"
] | 67 | 2020-09-22T10:17:53.000Z | 2022-02-16T10:24:17.000Z | acrobot.py | patrick-kidger/FasterNeuralDiffEq | 510ca2aa3f9864d0190640d8d8c37b3f208cdfc9 | [
"Apache-2.0"
] | 1 | 2021-11-02T06:51:09.000Z | 2021-11-02T17:55:42.000Z | acrobot.py | patrick-kidger/FasterNeuralDiffEq | 510ca2aa3f9864d0190640d8d8c37b3f208cdfc9 | [
"Apache-2.0"
] | 6 | 2020-09-30T08:21:18.000Z | 2022-03-02T20:17:14.000Z | import datasets
import models
import train
def main(device, norm, rtol=1e-4, atol=1e-4):
batch_size = 256
name = 'acrobot/' + '-'.join(map(str, [norm, rtol, atol])).replace('.', '-')
save = True
max_epochs = 50
lr = 1e-3
weight_decay = 0.01
times, train_dataloader, val_dataloader, test_da... | 25.64 | 115 | 0.648986 |
795229bc0a4a461da005a7d053801f77c20f2e01 | 144 | py | Python | isc_dhcp_leases/__init__.py | cacoyle/python-isc-dhcp-leases | dc513ea124565d77a7a5bde742ec0a8ffb877fd4 | [
"MIT"
] | 111 | 2015-02-11T21:36:40.000Z | 2022-03-18T13:36:12.000Z | isc_dhcp_leases/__init__.py | cacoyle/python-isc-dhcp-leases | dc513ea124565d77a7a5bde742ec0a8ffb877fd4 | [
"MIT"
] | 36 | 2015-05-05T12:04:07.000Z | 2021-06-17T12:58:30.000Z | isc_dhcp_leases/__init__.py | cacoyle/python-isc-dhcp-leases | dc513ea124565d77a7a5bde742ec0a8ffb877fd4 | [
"MIT"
] | 52 | 2015-05-02T19:31:20.000Z | 2022-03-18T13:36:29.000Z | from __future__ import absolute_import
from .iscdhcpleases import IscDhcpLeases, Lease, Lease6
__author__ = 'Martijn Braam <martijn@brixit.nl>'
| 36 | 55 | 0.826389 |
79522a218258c8f22606988d269a2f2892659528 | 4,152 | py | Python | scripts/floyd/floyd_distance_nb_cuda.py | linyuehzzz/hedetniemi_distance | e1e3378f7f7013e0e36f4026da1342beac725a98 | [
"Apache-2.0"
] | 1 | 2020-08-03T11:30:28.000Z | 2020-08-03T11:30:28.000Z | scripts/floyd/floyd_distance_nb_cuda.py | linyuehzzz/hedetniemi_distance | e1e3378f7f7013e0e36f4026da1342beac725a98 | [
"Apache-2.0"
] | null | null | null | scripts/floyd/floyd_distance_nb_cuda.py | linyuehzzz/hedetniemi_distance | e1e3378f7f7013e0e36f4026da1342beac725a98 | [
"Apache-2.0"
] | null | null | null | from timeit import default_timer
from numba import cuda, njit, float32
import numpy as np
import math
import timeout_decorator
##******** Read graph data ********##
## Number of nodes (100/1,000/10,000/100,000/1,000,000)
nodes = [100, 1000, 10000, 100000, 1000000]
print('Nodes: ', nodes)
## Total degree
degree = [3,... | 25.95 | 137 | 0.570568 |
79522a5bb5e8c3f38baa9fae104ace2cce30cc55 | 67,697 | py | Python | mmtbx/refinement/tst_occupancy_selections.py | mphancock/cctbx_project | ec8a239c5bcee9c9b2d1c6c95dc3fff2580bbb85 | [
"BSD-3-Clause-LBNL"
] | 2 | 2021-03-18T12:31:57.000Z | 2022-03-14T06:27:06.000Z | mmtbx/refinement/tst_occupancy_selections.py | mphancock/cctbx_project | ec8a239c5bcee9c9b2d1c6c95dc3fff2580bbb85 | [
"BSD-3-Clause-LBNL"
] | null | null | null | mmtbx/refinement/tst_occupancy_selections.py | mphancock/cctbx_project | ec8a239c5bcee9c9b2d1c6c95dc3fff2580bbb85 | [
"BSD-3-Clause-LBNL"
] | 1 | 2021-03-26T12:52:30.000Z | 2021-03-26T12:52:30.000Z | from __future__ import absolute_import, division, print_function
from mmtbx.monomer_library import pdb_interpretation
from mmtbx.refinement.occupancies import occupancy_selections
from mmtbx.command_line import fmodel
import mmtbx.model
from iotbx import file_reader
import iotbx.pdb
import iotbx.phil
from libtbx.test_u... | 51.994624 | 154 | 0.525326 |
79522ab9346408865a82ade12f54cd00c6577a2a | 2,339 | py | Python | kaggledatasets/structured/newyork_airbnb_opendata.py | kaggledatasets/kaggledatasets | 685d16590667443546f7ad2c31dfac8ad6be6ca2 | [
"Apache-2.0"
] | 48 | 2019-11-23T17:39:42.000Z | 2022-02-11T16:38:12.000Z | kaggledatasets/structured/newyork_airbnb_opendata.py | kaggledatasets/kaggledatasets | 685d16590667443546f7ad2c31dfac8ad6be6ca2 | [
"Apache-2.0"
] | 5 | 2019-11-30T14:20:18.000Z | 2019-12-10T12:07:54.000Z | kaggledatasets/structured/newyork_airbnb_opendata.py | kaggledatasets/kaggledatasets | 685d16590667443546f7ad2c31dfac8ad6be6ca2 | [
"Apache-2.0"
] | 6 | 2019-11-30T15:44:43.000Z | 2022-02-11T16:38:14.000Z | # Copyright 2019 Omkar Prabhu
#
# 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,... | 28.180723 | 89 | 0.64814 |
79522bf319980d74a78c34c31426ca3fa49ec229 | 988 | py | Python | login/login/urls.py | fga-eps-mds/2018.2-FGAPP-login | 942ba0e7b3164733f9a9e2a9c1c601f22289e65c | [
"MIT"
] | 1 | 2020-07-26T03:28:55.000Z | 2020-07-26T03:28:55.000Z | login/login/urls.py | bonfimjustino7/2018.2-FGAPP-login | 942ba0e7b3164733f9a9e2a9c1c601f22289e65c | [
"MIT"
] | 13 | 2018-09-21T22:52:48.000Z | 2018-12-11T14:50:07.000Z | login/login/urls.py | bonfimjustino7/2018.2-FGAPP-login | 942ba0e7b3164733f9a9e2a9c1c601f22289e65c | [
"MIT"
] | 1 | 2020-05-10T13:18:03.000Z | 2020-05-10T13:18:03.000Z | from django.contrib import admin
from django.urls import include, path
from django.conf.urls import url
from rest_framework_jwt.views import obtain_jwt_token
from rest_framework_jwt.views import refresh_jwt_token
from rest_framework_jwt.views import verify_jwt_token
from django.contrib.auth import views as auth_views
f... | 32.933333 | 59 | 0.752024 |
79522cac960717d425fa70c0e6ff58239437a81f | 1,064 | py | Python | var/spack/repos/builtin/packages/r-affxparser/package.py | HaochengLIU/spack | 26e51ff1705a4d6234e2a0cf734f93f7f95df5cb | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 2 | 2018-11-27T03:39:44.000Z | 2021-09-06T15:50:35.000Z | var/spack/repos/builtin/packages/r-affxparser/package.py | HaochengLIU/spack | 26e51ff1705a4d6234e2a0cf734f93f7f95df5cb | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 1 | 2019-01-11T20:11:52.000Z | 2019-01-11T20:11:52.000Z | var/spack/repos/builtin/packages/r-affxparser/package.py | HaochengLIU/spack | 26e51ff1705a4d6234e2a0cf734f93f7f95df5cb | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 1 | 2020-10-14T14:20:17.000Z | 2020-10-14T14:20:17.000Z | # Copyright 2013-2018 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class RAffxparser(RPackage):
"""Package for parsing Affymetrix files (CDF, CEL, CHP, BPMAP, BAR)... | 42.56 | 75 | 0.734023 |
79522cec803b3145ececdde954556c68e18686dc | 4,206 | py | Python | patent_system/settings.py | zypangpang/patent_management_system | 5c9307359ac2fbb7fdfa2beff63f58f441932f86 | [
"Apache-2.0"
] | null | null | null | patent_system/settings.py | zypangpang/patent_management_system | 5c9307359ac2fbb7fdfa2beff63f58f441932f86 | [
"Apache-2.0"
] | null | null | null | patent_system/settings.py | zypangpang/patent_management_system | 5c9307359ac2fbb7fdfa2beff63f58f441932f86 | [
"Apache-2.0"
] | null | null | null | """
Django settings for patent_system project.
Generated by 'django-admin startproject' using Django 2.1.1.
For more information on this file, see
https://docs.djangoproject.com/en/2.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.1/ref/settings/
"""
import... | 26.124224 | 91 | 0.638849 |
79522e7fac28cbf45ac1cb1a9fec3f0eaea6c8e7 | 5,179 | py | Python | instances/fcn/voc.fcn32s.R101_v1c/train.py | dontLoveBugs/MyTorch | d14bd1a231bde7f2e05282f86c640bcce4a55baf | [
"MIT"
] | 1 | 2020-02-25T00:35:00.000Z | 2020-02-25T00:35:00.000Z | instances/fcn/voc.fcn32s.R101_v1c/train.py | dontLoveBugs/MyTorch | d14bd1a231bde7f2e05282f86c640bcce4a55baf | [
"MIT"
] | null | null | null | instances/fcn/voc.fcn32s.R101_v1c/train.py | dontLoveBugs/MyTorch | d14bd1a231bde7f2e05282f86c640bcce4a55baf | [
"MIT"
] | null | null | null | from __future__ import division
import os.path as osp
import sys
import argparse
from tqdm import tqdm
import torch
import torch.nn as nn
import torch.distributed as dist
import torch.backends.cudnn as cudnn
from torch.nn.parallel import DistributedDataParallel
from config import config
from dataloader import get_tra... | 35.231293 | 82 | 0.603591 |
79522f1372f3cd0428507a0a68a60f9495aa571a | 1,220 | py | Python | models/G2G.py | GCL-staging/PyGCL | 6cf2f4475053c631c6db1b8a2412bd811b586275 | [
"Apache-2.0"
] | null | null | null | models/G2G.py | GCL-staging/PyGCL | 6cf2f4475053c631c6db1b8a2412bd811b586275 | [
"Apache-2.0"
] | null | null | null | models/G2G.py | GCL-staging/PyGCL | 6cf2f4475053c631c6db1b8a2412bd811b586275 | [
"Apache-2.0"
] | null | null | null | import torch
import GCL.augmentors as A
from torch import nn
from typing import Optional, Tuple
from torch_geometric.nn import global_add_pool
class G2G(nn.Module):
def __init__(self, encoder: torch.nn.Module,
augmentor: Tuple[A.Augmentor, A.Augmentor],
loss,
hi... | 34.857143 | 91 | 0.641803 |
7952305a3f519ed35602ba78cda5315c43f22312 | 2,355 | py | Python | debug_cqlnml_converter.py | garrettwrong/cql3d_f90 | 15ad9094ff2e2a29f6f5c3810b5b8c4fc724f2f8 | [
"DOC"
] | 1 | 2019-06-23T12:11:16.000Z | 2019-06-23T12:11:16.000Z | debug_cqlnml_converter.py | garrettwrong/cql3d_f90 | 15ad9094ff2e2a29f6f5c3810b5b8c4fc724f2f8 | [
"DOC"
] | 38 | 2019-06-06T20:30:25.000Z | 2019-12-13T17:05:56.000Z | debug_cqlnml_converter.py | garrettwrong/cql3d_f90 | 15ad9094ff2e2a29f6f5c3810b5b8c4fc724f2f8 | [
"DOC"
] | null | null | null | #!/usr/bin/env python
'''
In the process of running TRANSP, it can dump a debug nml.
At the time of writing this dump is enabled for MPI runs, to assist transition.
Developers may make this optional, perhaps only for debugging, in the future.
This namelist comes _from within cql3d_f90_ and so uses f90 derived type sy... | 27.383721 | 80 | 0.613588 |
795231b20e223ea6419a12a5d89fa53b912efe92 | 149 | py | Python | test/test_login.py | DmitriyNeurov/python_training_mantis | db94fad4e01e7d29a962d80791c984ddcacf1033 | [
"Apache-2.0"
] | null | null | null | test/test_login.py | DmitriyNeurov/python_training_mantis | db94fad4e01e7d29a962d80791c984ddcacf1033 | [
"Apache-2.0"
] | null | null | null | test/test_login.py | DmitriyNeurov/python_training_mantis | db94fad4e01e7d29a962d80791c984ddcacf1033 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
def test_login(app):
app.session.login("administrator", "root")
assert app.session.is_logget_in_as("administrator")
| 24.833333 | 55 | 0.684564 |
795231d674d2da24e3def8b22bf4ddf5c425e00c | 9,667 | py | Python | style_transfer.py | Ashiroes/flask_api_dl | 2a39b653ad2de7fd5da48735b4711d791ce62053 | [
"Apache-2.0"
] | null | null | null | style_transfer.py | Ashiroes/flask_api_dl | 2a39b653ad2de7fd5da48735b4711d791ce62053 | [
"Apache-2.0"
] | null | null | null | style_transfer.py | Ashiroes/flask_api_dl | 2a39b653ad2de7fd5da48735b4711d791ce62053 | [
"Apache-2.0"
] | null | null | null | # =======================================================================================================================
# TRANSFERT DE STYLE
# =======================================================================================================================
import base64
import json
import time
from io import By... | 38.059055 | 146 | 0.642702 |
795232c30179af89fbb4c7c519cdd51a417c7b5d | 602 | py | Python | site-root/.py/model/map.py | TED-996/krait-twostones | 51b27793b9cd536d680fb9a6785c57473d35cac1 | [
"MIT"
] | null | null | null | site-root/.py/model/map.py | TED-996/krait-twostones | 51b27793b9cd536d680fb9a6785c57473d35cac1 | [
"MIT"
] | null | null | null | site-root/.py/model/map.py | TED-996/krait-twostones | 51b27793b9cd536d680fb9a6785c57473d35cac1 | [
"MIT"
] | null | null | null | import json
import krait
import os
class Map(object):
def __init__(self, mapId, source_file):
self.id = mapId
self.source_file = source_file
self.height = 0
self.width = 0
self.data = []
self.parse_map()
def parse_map(self):
fd = open(os.path.join(krait.... | 25.083333 | 89 | 0.586379 |
7952340753498b4f82d22f5cf08643b00e4f23cb | 244 | py | Python | src/ps_collector/__init__.py | djw8605/ps-collector | 34d5fe8bd3db231157140f3fbfee7dd46f35be2a | [
"Apache-2.0"
] | null | null | null | src/ps_collector/__init__.py | djw8605/ps-collector | 34d5fe8bd3db231157140f3fbfee7dd46f35be2a | [
"Apache-2.0"
] | null | null | null | src/ps_collector/__init__.py | djw8605/ps-collector | 34d5fe8bd3db231157140f3fbfee7dd46f35be2a | [
"Apache-2.0"
] | null | null | null |
import sharedrabbitmq
# Shared RabbitMQ
shared_rabbitmq = None
def get_rabbitmq_connection(cp):
global shared_rabbitmq
if shared_rabbitmq == None:
shared_rabbitmq = sharedrabbitmq.SharedRabbitMQ(cp)
return shared_rabbitmq | 22.181818 | 59 | 0.77459 |
79523424bd4038cb5a99d435355827070b1c0505 | 643 | py | Python | backend/manage.py | crowdbotics-apps/morning-waterfall-30060 | 45d08f37cc5bd66fb3b494a3162bb2273523f91c | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/manage.py | crowdbotics-apps/morning-waterfall-30060 | 45d08f37cc5bd66fb3b494a3162bb2273523f91c | [
"FTL",
"AML",
"RSA-MD"
] | 32 | 2021-08-23T23:51:20.000Z | 2022-03-20T15:31:58.000Z | backend/manage.py | crowdbotics-apps/morning-waterfall-30060 | 45d08f37cc5bd66fb3b494a3162bb2273523f91c | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | #!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'morning_waterfall_30060.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
... | 29.227273 | 87 | 0.690513 |
79523499776726250bf489f010945bdb7bc69d4b | 4,571 | py | Python | autodist/kernel/synchronization/synchronizer.py | big-data-lab-umbc/autodist | c8514b27cf5608f35254b63c4ac8093c7295a8e7 | [
"Apache-2.0"
] | null | null | null | autodist/kernel/synchronization/synchronizer.py | big-data-lab-umbc/autodist | c8514b27cf5608f35254b63c4ac8093c7295a8e7 | [
"Apache-2.0"
] | null | null | null | autodist/kernel/synchronization/synchronizer.py | big-data-lab-umbc/autodist | c8514b27cf5608f35254b63c4ac8093c7295a8e7 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Petuum. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... | 38.411765 | 115 | 0.660906 |
795234a535a4b848e922d273d92232252bd9ca5b | 666 | py | Python | test/unit/test_utils.py | kzawisto/arima_python | 251b3ce28dedfe3118befeb7b008c4e7c91e33cf | [
"MIT"
] | 4 | 2020-04-07T07:18:07.000Z | 2021-12-13T10:09:13.000Z | test/unit/test_utils.py | kzawisto/arima_python | 251b3ce28dedfe3118befeb7b008c4e7c91e33cf | [
"MIT"
] | null | null | null | test/unit/test_utils.py | kzawisto/arima_python | 251b3ce28dedfe3118befeb7b008c4e7c91e33cf | [
"MIT"
] | 2 | 2021-12-02T15:06:09.000Z | 2022-01-15T18:09:30.000Z | from nose.tools import *
from arima.utils import *
from hamcrest import *
def test_np_shift():
assert_that(np_shift([1, 2, 3, 4], 2, -1), only_contains(-1, -1, 1, 2))
assert_that(np_shift([1, 2, 3, 4], -2, -1), only_contains(3, 4, -1, -1))
assert_that(np_shift([1, 2, 3, 4], 0, -1), only_contains(1, 2, 3, ... | 30.272727 | 76 | 0.555556 |
795234d3acc9261e8dd3b2994c4e3a04b7105bf0 | 8,187 | py | Python | statsig.py | jensengroup/statsig | f59754c66eb6c12de3e6563c08d4e12a2ec0d6ee | [
"MIT"
] | 2 | 2017-02-19T10:55:03.000Z | 2018-01-09T11:57:49.000Z | statsig.py | jensengroup/statsig | f59754c66eb6c12de3e6563c08d4e12a2ec0d6ee | [
"MIT"
] | 2 | 2017-01-09T18:49:18.000Z | 2017-02-21T20:08:20.000Z | statsig.py | jensengroup/statsig | f59754c66eb6c12de3e6563c08d4e12a2ec0d6ee | [
"MIT"
] | 3 | 2016-12-15T08:16:46.000Z | 2021-04-24T10:54:01.000Z | import numpy as np
check = "rmse"
#check = "pearson"
def correl(X,Y):
N, = X.shape
if N < 9:
print "not enough points. {} datapoints given. at least 9 is required".format(n)
return
r = np.corrcoef(X,Y)[0][1]
r_sig = 1.96/np.sqrt(n-2+1.96**2)
F_plus = 0.5*np.log((1+r)/(1-r))+r_sig... | 25.425466 | 123 | 0.562233 |
7952366c676a7a29d90e5013ad86e14768a5dd11 | 2,023 | py | Python | L-System.py | Moonire/L-system_python | b21f2d7a7b9dd571f47c95fda3cad5e8cff2e00b | [
"MIT"
] | null | null | null | L-System.py | Moonire/L-system_python | b21f2d7a7b9dd571f47c95fda3cad5e8cff2e00b | [
"MIT"
] | null | null | null | L-System.py | Moonire/L-system_python | b21f2d7a7b9dd571f47c95fda3cad5e8cff2e00b | [
"MIT"
] | null | null | null | import matplotlib.pyplot as plt
import numpy as np
"""
Non Stochastic Context free L-system implementation for python 3.x
Conformaly to the description given in 'The Algorithmic Beauty of Plants' by Lindenmayer (algorithmicbotany.org/papers/abop/abop.pdf)
i.e : the angles are in degrees and grow clockwise
su... | 30.651515 | 134 | 0.587741 |
7952367810c53905c83c957437db2994c42cb727 | 17,004 | py | Python | pymatgen/io/abinitio/abiinspect.py | ctoher/pymatgen | 54df358f61fbe60417e90850811b75c1a9e2e230 | [
"MIT"
] | null | null | null | pymatgen/io/abinitio/abiinspect.py | ctoher/pymatgen | 54df358f61fbe60417e90850811b75c1a9e2e230 | [
"MIT"
] | null | null | null | pymatgen/io/abinitio/abiinspect.py | ctoher/pymatgen | 54df358f61fbe60417e90850811b75c1a9e2e230 | [
"MIT"
] | null | null | null | # coding: utf-8
"""
This module provides objects to inspect the status of the Abinit tasks at run-time.
by extracting information from the main output file (text format).
"""
from __future__ import unicode_literals, division, print_function
import collections
import numpy as np
import yaml
import six
from six.moves i... | 29.317241 | 116 | 0.563985 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.