hexsha stringlengths 40 40 | size int64 3 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 972 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 3 972 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 3 972 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 3 1.03M | avg_line_length float64 1.13 941k | max_line_length int64 2 941k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
9a360485c6a7cdee6830e859c1fb43cef3c9182a | 1,122 | py | Python | tests/test_patterns.py | aaronspring/climetlab | 05a478d373f29415304064ca2449b19121e0a856 | [
"Apache-2.0"
] | 1 | 2021-10-02T12:30:12.000Z | 2021-10-02T12:30:12.000Z | tests/test_patterns.py | aaronspring/climetlab | 05a478d373f29415304064ca2449b19121e0a856 | [
"Apache-2.0"
] | null | null | null | tests/test_patterns.py | aaronspring/climetlab | 05a478d373f29415304064ca2449b19121e0a856 | [
"Apache-2.0"
] | null | null | null | # (C) Copyright 2020 ECMWF.
#
# This software is licensed under the terms of the Apache Licence Version 2.0
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
# In applying this licence, ECMWF does not waive the privileges and immunities
# granted to it by virtue of its status as an intergovernmenta... | 29.526316 | 87 | 0.637255 |
61145dbd128bc2ee3d18302803b3b4fecd2e6655 | 4,598 | py | Python | pkg/system/auth.py | ToraNova/rapidflask | f42354b296659dac5be904d7bb68076b9458f79a | [
"MIT"
] | null | null | null | pkg/system/auth.py | ToraNova/rapidflask | f42354b296659dac5be904d7bb68076b9458f79a | [
"MIT"
] | null | null | null | pkg/system/auth.py | ToraNova/rapidflask | f42354b296659dac5be904d7bb68076b9458f79a | [
"MIT"
] | null | null | null | #--------------------------------------------------
# auth.py
# this file is meant to store routes for authentication
# purposes such as login/logout or any other administr
# tasks
# introduced 8/12/2018
#--------------------------------------------------
#security and login imports
from flask_login import login_requi... | 38.316667 | 114 | 0.60896 |
e72b515e262229baa396495af3a4acae8d6fb286 | 10,739 | py | Python | sandbox/processor.py | vallsv/pyFAI | 64143652c2b219978ec370bf2fa215af01f937c2 | [
"MIT"
] | null | null | null | sandbox/processor.py | vallsv/pyFAI | 64143652c2b219978ec370bf2fa215af01f937c2 | [
"MIT"
] | 1 | 2016-09-12T11:58:05.000Z | 2016-09-12T11:58:05.000Z | sandbox/processor.py | vallsv/pyFAI | 64143652c2b219978ec370bf2fa215af01f937c2 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Project: Azimuthal integration
# https://github.com/silx-kit/pyFAI
#
#
# Copyright (C) European Synchrotron Radiation Facility, Grenoble, France
#
# Principal author: Jérôme Kieffer (Jerome.Kieffer@ESRF.eu)
#
# This program is free software... | 42.113725 | 95 | 0.561225 |
f18fde2d7cad81f08fe53e863c1eb129112958d2 | 1,769 | py | Python | src/minimum_spanning_tree/tests/test_runtime.py | jtara1/AlgorithmsAndDataStructures | fed323344018c6a63d599666f368037124f2a8c7 | [
"MIT"
] | null | null | null | src/minimum_spanning_tree/tests/test_runtime.py | jtara1/AlgorithmsAndDataStructures | fed323344018c6a63d599666f368037124f2a8c7 | [
"MIT"
] | null | null | null | src/minimum_spanning_tree/tests/test_runtime.py | jtara1/AlgorithmsAndDataStructures | fed323344018c6a63d599666f368037124f2a8c7 | [
"MIT"
] | null | null | null | from src.minimum_spanning_tree import prim, kruskal, Graph
from src import runtime
def test_sparse_graph():
print('\ntest_sparse_graph')
# sizes = [100, 500]
sizes = [100, 500, 1000, 5000]
# sizes = [100, 500, 1000, 5000, 10000]
args = [(Graph.create_graph(size, dense=False),) for size in sizes]
... | 32.759259 | 77 | 0.604296 |
fae7f3f7b8b05bbf83a2c1ae5884351321126970 | 888 | py | Python | setup.py | jeffrey-cochran/nurbs-algorithms | 58378bd27cb8df2b8a06b3b2f92645523ad858b7 | [
"MIT"
] | null | null | null | setup.py | jeffrey-cochran/nurbs-algorithms | 58378bd27cb8df2b8a06b3b2f92645523ad858b7 | [
"MIT"
] | null | null | null | setup.py | jeffrey-cochran/nurbs-algorithms | 58378bd27cb8df2b8a06b3b2f92645523ad858b7 | [
"MIT"
] | null | null | null | from distutils.core import setup
from setuptools import find_packages
KEYWORDS = ['NURBS']
CLASSIFIERS = [
'Development Status :: 3 - Alpha',
'License :: OSI Approved :: MIT License',
'Operating System :: Microsoft :: Windows',
'Programming Language :: Python :: 3.6',
]
with open('__versi... | 26.909091 | 100 | 0.652027 |
76bb73b908fdf655427c896b523499db71805776 | 1,727 | py | Python | heron/tracker/src/python/handlers/logicalplanhandler.py | dabaitu/heron | a7fdde5ca4484e4d6c4a73ec36ce43fc9dd1c4c8 | [
"Apache-2.0"
] | null | null | null | heron/tracker/src/python/handlers/logicalplanhandler.py | dabaitu/heron | a7fdde5ca4484e4d6c4a73ec36ce43fc9dd1c4c8 | [
"Apache-2.0"
] | null | null | null | heron/tracker/src/python/handlers/logicalplanhandler.py | dabaitu/heron | a7fdde5ca4484e4d6c4a73ec36ce43fc9dd1c4c8 | [
"Apache-2.0"
] | 1 | 2019-10-02T15:23:46.000Z | 2019-10-02T15:23:46.000Z | # Copyright 2016 Twitter. 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 agree... | 33.862745 | 89 | 0.741749 |
9b427a806948055614ee6704a30f0eb1cbb06b7b | 240 | py | Python | 1.-Hola_mundo_python.py | emiliocarcanobringas/1.-Hola_mundo_python | 6220b00598eff5f1c85653e211924f3d9c6b4d6e | [
"MIT"
] | null | null | null | 1.-Hola_mundo_python.py | emiliocarcanobringas/1.-Hola_mundo_python | 6220b00598eff5f1c85653e211924f3d9c6b4d6e | [
"MIT"
] | null | null | null | 1.-Hola_mundo_python.py | emiliocarcanobringas/1.-Hola_mundo_python | 6220b00598eff5f1c85653e211924f3d9c6b4d6e | [
"MIT"
] | null | null | null | # Este programa muestra como imprimir un mensaje en pantalla.
print("Estoy orgulloso de pertenecer a Uninaciones y estudiar en la UNAM")
print("Mi nombre es Emilio Carcaño Bringas")
#Este programa fue escrito por Emilio Carcaño Bringas | 48 | 75 | 0.791667 |
7ee8cc94ee96f2f4b491e0bb67125de2aefe2db2 | 3,205 | py | Python | src/plot_qualifying_results.py | szymonos/f1 | 77d54a00fa9aaf18cab0ab1dbb78e88dd39b3478 | [
"MIT"
] | 1 | 2022-01-16T14:36:42.000Z | 2022-01-16T14:36:42.000Z | src/plot_qualifying_results.py | szymonos/f1 | 77d54a00fa9aaf18cab0ab1dbb78e88dd39b3478 | [
"MIT"
] | null | null | null | src/plot_qualifying_results.py | szymonos/f1 | 77d54a00fa9aaf18cab0ab1dbb78e88dd39b3478 | [
"MIT"
] | null | null | null | """
Qualifying results overview
===========================
Plot the qualifying result with visualization the fastest times.
"""
import fastf1
import fastf1.plotting
import matplotlib.pyplot as plt
import pandas as pd
from fastf1.core import Laps
from timple.timedelta import strftimedelta
fastf1.Cache.enable_cache(".... | 31.732673 | 87 | 0.615601 |
45b4821130a58493444ce337a7fdfa27ed69cfa7 | 2,852 | py | Python | rcnn/modeling/fast_rcnn/fast_rcnn.py | yf19970118/OPLD-Pytorch | 4939bf62587da4533276fda20db36bb019575511 | [
"MIT"
] | 25 | 2020-08-28T07:28:16.000Z | 2022-03-06T06:18:56.000Z | rcnn/modeling/fast_rcnn/fast_rcnn.py | yf19970118/OPLD-Pytorch | 4939bf62587da4533276fda20db36bb019575511 | [
"MIT"
] | 5 | 2020-12-22T07:42:50.000Z | 2021-07-12T01:49:57.000Z | rcnn/modeling/fast_rcnn/fast_rcnn.py | yf19970118/OPLD-Pytorch | 4939bf62587da4533276fda20db36bb019575511 | [
"MIT"
] | 4 | 2020-12-19T03:14:26.000Z | 2021-12-17T12:38:37.000Z | import torch
from torch import nn
from rcnn.modeling.fast_rcnn import heads
from rcnn.modeling.fast_rcnn import outputs
from rcnn.modeling.fast_rcnn.inference import box_post_processor
from rcnn.modeling.fast_rcnn.loss import box_loss_evaluator
from rcnn.modeling import registry
from rcnn.core.config import cfg
clas... | 40.742857 | 81 | 0.686185 |
e4b7d18b111eb999e77c8b8df9d807b9c67f027c | 1,487 | py | Python | tests/ampligraph/latent_features/test_regularizers.py | chauvu/AmpliGraph | 783d885b38e82c991a308f26d26eeb5d3513fcc3 | [
"Apache-2.0"
] | 1,794 | 2019-03-15T11:04:13.000Z | 2022-03-31T15:58:02.000Z | tests/ampligraph/latent_features/test_regularizers.py | chauvu/AmpliGraph | 783d885b38e82c991a308f26d26eeb5d3513fcc3 | [
"Apache-2.0"
] | 175 | 2019-03-15T12:02:25.000Z | 2022-03-18T05:04:27.000Z | tests/ampligraph/latent_features/test_regularizers.py | chauvu/AmpliGraph | 783d885b38e82c991a308f26d26eeb5d3513fcc3 | [
"Apache-2.0"
] | 210 | 2019-03-17T13:28:04.000Z | 2022-03-19T13:19:41.000Z | # Copyright 2019-2021 The AmpliGraph Authors. All Rights Reserved.
#
# This file is Licensed under the Apache License, Version 2.0.
# A copy of the Licence is available in LICENCE, or at:
#
# http://www.apache.org/licenses/LICENSE-2.0
#
import numpy as np
import tensorflow as tf
from ampligraph.latent_features impo... | 33.044444 | 66 | 0.636853 |
9f04caad029366e4e2794b7990cb0eae0ffae7de | 13,496 | py | Python | flask_limiter/extension.py | sys-git/flask-limiter | 169f1c4ca4105b06ea53f734d2c071c0a0869334 | [
"MIT"
] | null | null | null | flask_limiter/extension.py | sys-git/flask-limiter | 169f1c4ca4105b06ea53f734d2c071c0a0869334 | [
"MIT"
] | null | null | null | flask_limiter/extension.py | sys-git/flask-limiter | 169f1c4ca4105b06ea53f734d2c071c0a0869334 | [
"MIT"
] | null | null | null | """
the flask extension
"""
from functools import wraps
import logging
from flask import request, current_app, g, Blueprint
from .errors import RateLimitExceeded, ConfigurationError
from flask.ext.limiter.storage import storage_from_string
from .strategies import STRATEGIES
from .util import parse_many, get_ipaddr
... | 38.016901 | 118 | 0.562241 |
1f31bb3a366cd552b155492fed0f6573612265ad | 2,054 | py | Python | SUAVE/SUAVE-2.5.0/trunk/SUAVE/Components/Energy/Converters/Generator_Zero_Fid.py | Vinicius-Tanigawa/Undergraduate-Research-Project | e92372f07882484b127d7affe305eeec2238b8a9 | [
"MIT"
] | null | null | null | SUAVE/SUAVE-2.5.0/trunk/SUAVE/Components/Energy/Converters/Generator_Zero_Fid.py | Vinicius-Tanigawa/Undergraduate-Research-Project | e92372f07882484b127d7affe305eeec2238b8a9 | [
"MIT"
] | null | null | null | SUAVE/SUAVE-2.5.0/trunk/SUAVE/Components/Energy/Converters/Generator_Zero_Fid.py | Vinicius-Tanigawa/Undergraduate-Research-Project | e92372f07882484b127d7affe305eeec2238b8a9 | [
"MIT"
] | null | null | null | ## @ingroup Components-Energy-Converters
# Generator_Zero_Fid.py
#
# Created: Apr 2019, C. McMillan
# ----------------------------------------------------------------------
# Imports
# ----------------------------------------------------------------------
# suave imports
import SUAVE
# package imports
from SUAVE.... | 23.340909 | 95 | 0.472736 |
8d5e500d18b26e51bfd9495e51a59b43ee4ac50b | 912 | py | Python | tEvash/tevash_09.py | techartorg/Advent_of_Code_2020 | ae21164bc126352e7a2e9c9c6a0017ccb9d946cc | [
"MIT"
] | 3 | 2020-11-16T15:20:11.000Z | 2020-12-11T17:01:42.000Z | tEvash/tevash_09.py | techartorg/Advent_of_Code_2020 | ae21164bc126352e7a2e9c9c6a0017ccb9d946cc | [
"MIT"
] | null | null | null | tEvash/tevash_09.py | techartorg/Advent_of_Code_2020 | ae21164bc126352e7a2e9c9c6a0017ccb9d946cc | [
"MIT"
] | 1 | 2020-12-13T04:42:44.000Z | 2020-12-13T04:42:44.000Z | from itertools import combinations
with open("inputs_9.txt") as f:
inputs = [int(x) for x in f.readlines()]
ex_inputs = [
35,
20,
15,
25,
47,
40,
62,
55,
65,
95,
102,
117,
150,
182,
127,
219,
299,
277,
309,
576
]
def part1(inputs, pre_len = 25):
index = pre_len
while index < len(inputs):
nu... | 14.25 | 73 | 0.618421 |
96b5f28e56b47bdbfa16bb502dcdef57c4cfc52c | 6,509 | py | Python | autojail/utils/collections.py | ekut-es/autojail | bc16e40e6df55c0a28a3059715851ffa59b14ba8 | [
"MIT"
] | 6 | 2020-08-12T08:16:15.000Z | 2022-03-05T02:25:53.000Z | autojail/utils/collections.py | ekut-es/autojail | bc16e40e6df55c0a28a3059715851ffa59b14ba8 | [
"MIT"
] | 1 | 2021-03-30T10:34:51.000Z | 2021-06-09T11:24:00.000Z | autojail/utils/collections.py | ekut-es/autojail | bc16e40e6df55c0a28a3059715851ffa59b14ba8 | [
"MIT"
] | 1 | 2021-11-21T09:30:58.000Z | 2021-11-21T09:30:58.000Z | from bisect import bisect_left, bisect_right
class SortedCollection:
"""Sequence sorted by a key function.
SortedCollection() is much easier to work with than using bisect() directly.
It supports key functions like those use in sorted(), min(), and max().
The result of the key function call is saved ... | 33.040609 | 82 | 0.594254 |
29e142d6a16cd3c1387b751d3040abed9a17fbdf | 45 | py | Python | RevitPythonShell_Scripts/GoogleTools.extension/GoogleTools.tab/Info.Panel/Info.pushbutton/script.py | arupiot/create_revit_families | 9beab3c7e242426b2dca99ca5477fdb433e39db2 | [
"MIT"
] | 1 | 2021-02-04T18:20:58.000Z | 2021-02-04T18:20:58.000Z | RevitPythonShell_Scripts/GoogleTools.extension/GoogleTools.tab/Info.Panel/Info.pushbutton/script.py | arupiot/DBOTools | 9beab3c7e242426b2dca99ca5477fdb433e39db2 | [
"MIT"
] | null | null | null | RevitPythonShell_Scripts/GoogleTools.extension/GoogleTools.tab/Info.Panel/Info.pushbutton/script.py | arupiot/DBOTools | 9beab3c7e242426b2dca99ca5477fdb433e39db2 | [
"MIT"
] | null | null | null | import sys
print(sys.version)
print(sys.path) | 15 | 18 | 0.8 |
2fc618d542249729823a3c73f4a5b06020143965 | 672 | py | Python | Chapter10/myproject_docker/apps/magazine/migrations/0001_initial.py | PacktPublishing/Django-2-Web-Development-Cookbook-Third-Edition | f129613e2b1d00f5c76649025ae4d568f6286f2c | [
"MIT"
] | 75 | 2018-12-03T02:35:29.000Z | 2021-11-08T13:13:34.000Z | Chapter10/virtualenvs/myproject_env/project/django-myproject/magazine/migrations/0001_initial.py | PacktPublishing/Django-2-Web-Development-Cookbook-Third-Edition | f129613e2b1d00f5c76649025ae4d568f6286f2c | [
"MIT"
] | 3 | 2019-08-11T13:35:01.000Z | 2020-09-29T06:52:36.000Z | Chapter08/virtualenvs/myproject_env/project/django-myproject/magazine/migrations/0001_initial.py | PacktPublishing/Django-2-Web-Development-Cookbook-Third-Edition | f129613e2b1d00f5c76649025ae4d568f6286f2c | [
"MIT"
] | 45 | 2018-11-03T14:03:22.000Z | 2021-08-25T07:39:33.000Z | # Generated by Django 2.1.1 on 2018-09-06 16:22
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='NewsArticle',
fields=[
('id', models.AutoFi... | 24.888889 | 114 | 0.535714 |
5a51095ebbc098c70da6f65ad4afbc6dcc97bf5f | 6,556 | py | Python | thrift/lib/py3/test/server.py | andkg/fbthrift | 4c46640fbf01c69e06107b22f93eb83e03a21458 | [
"Apache-2.0"
] | null | null | null | thrift/lib/py3/test/server.py | andkg/fbthrift | 4c46640fbf01c69e06107b22f93eb83e03a21458 | [
"Apache-2.0"
] | null | null | null | thrift/lib/py3/test/server.py | andkg/fbthrift | 4c46640fbf01c69e06107b22f93eb83e03a21458 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
#
# 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 require... | 35.825137 | 84 | 0.684106 |
430418fd0996d474c1a13cef523eb242ba517289 | 2,272 | py | Python | xutils/decorators.py | iLampard/x-utils | 291d92832ee0e0c89bc22e10ecf2f44445e0d300 | [
"Apache-2.0"
] | 5 | 2017-08-31T06:12:43.000Z | 2018-05-25T08:42:13.000Z | xutils/decorators.py | iLampard/x-utils | 291d92832ee0e0c89bc22e10ecf2f44445e0d300 | [
"Apache-2.0"
] | 2 | 2017-12-20T07:35:17.000Z | 2017-12-29T06:04:58.000Z | xutils/decorators.py | iLampard/x-utils | 291d92832ee0e0c89bc22e10ecf2f44445e0d300 | [
"Apache-2.0"
] | 8 | 2017-12-04T00:59:30.000Z | 2019-09-20T02:06:13.000Z | # -*- coding: utf-8 -*-
import time
from xutils.misc import valid_dict
import functools
import smtplib
from email.mime.text import MIMEText
def _send(subject, text, sender, username, password, host, receiver):
msg = MIMEText(text, 'plain', 'utf-8')
msg['Subject'] = subject
smtp = smtplib.SMTP()
smtp... | 31.555556 | 111 | 0.560299 |
73fac375adeef8cf724126b8ee5d9839669fd8f3 | 18,524 | py | Python | openmdao/utils/assert_utils.py | LeeElvis/OpenMDAO | e9e002054c0ecad7467da2a7bbb8fdf68fccfb8c | [
"Apache-2.0"
] | null | null | null | openmdao/utils/assert_utils.py | LeeElvis/OpenMDAO | e9e002054c0ecad7467da2a7bbb8fdf68fccfb8c | [
"Apache-2.0"
] | null | null | null | openmdao/utils/assert_utils.py | LeeElvis/OpenMDAO | e9e002054c0ecad7467da2a7bbb8fdf68fccfb8c | [
"Apache-2.0"
] | null | null | null | """
Functions for making assertions about OpenMDAO Systems.
"""
import numpy as np
from math import isnan
import warnings
import unittest
from contextlib import contextmanager
from functools import wraps
from openmdao.core.component import Component
from openmdao.core.group import Group
from openmdao.jacobians.dicti... | 35.899225 | 100 | 0.567156 |
501974e4eb79d0f448e434960fee6a0df74f9856 | 76 | py | Python | src/robots/poses/__init__.py | severin-lemaignan/pyrobots | d5dd3bd54375e85802de7225556ad519b8b4e89d | [
"0BSD"
] | 11 | 2017-03-06T17:19:59.000Z | 2021-11-04T07:45:33.000Z | src/robots/poses/__init__.py | severin-lemaignan/pyrobots | d5dd3bd54375e85802de7225556ad519b8b4e89d | [
"0BSD"
] | 2 | 2018-08-18T12:43:47.000Z | 2019-04-23T13:03:26.000Z | src/robots/poses/__init__.py | severin-lemaignan/pyrobots | d5dd3bd54375e85802de7225556ad519b8b4e89d | [
"0BSD"
] | 3 | 2018-04-24T10:25:53.000Z | 2021-08-25T04:34:35.000Z | # coding=utf-8
from .position import *
from .ros_positions import ROSFrames
| 19 | 36 | 0.789474 |
b74f6863310c06d24917b2f0381d038eff9e722d | 2,232 | py | Python | visualizer.py | AliAbbasi/LANLEarthquakePrediction | 8ea8d181def786cbbf0628bb89bf9df76351cae4 | [
"MIT"
] | null | null | null | visualizer.py | AliAbbasi/LANLEarthquakePrediction | 8ea8d181def786cbbf0628bb89bf9df76351cae4 | [
"MIT"
] | null | null | null | visualizer.py | AliAbbasi/LANLEarthquakePrediction | 8ea8d181def786cbbf0628bb89bf9df76351cae4 | [
"MIT"
] | null | null | null | import numpy as np
import pandas as pd
import os
import matplotlib.pyplot as plt
from sklearn.preprocessing import StandardScaler
from sklearn.svm import NuSVR, SVR
from sklearn.metrics import mean_absolute_error
pd.options.display.precision = 15
import lightgbm as lgb
import xgboost as xgb
import time
import datet... | 33.818182 | 165 | 0.783154 |
279b87e4862d29aaae73ee3163d29e95bbb07b15 | 4,639 | py | Python | recipes/autoconf/all/conanfile.py | dpronin/conan-center-index | 5c6e41a618097d04e731c9831118a51dcb39ab3f | [
"MIT"
] | 1 | 2021-11-11T03:07:13.000Z | 2021-11-11T03:07:13.000Z | recipes/autoconf/all/conanfile.py | dpronin/conan-center-index | 5c6e41a618097d04e731c9831118a51dcb39ab3f | [
"MIT"
] | 1 | 2021-11-22T13:54:48.000Z | 2021-11-22T14:09:45.000Z | recipes/autoconf/all/conanfile.py | dpronin/conan-center-index | 5c6e41a618097d04e731c9831118a51dcb39ab3f | [
"MIT"
] | null | null | null | from conans import AutoToolsBuildEnvironment, ConanFile, tools
import contextlib
import os
required_conan_version = ">=1.33.0"
class AutoconfConan(ConanFile):
name = "autoconf"
url = "https://github.com/conan-io/conan-center-index"
homepage = "https://www.gnu.org/software/autoconf/"
description = "Au... | 37.715447 | 150 | 0.661781 |
5fdc8f2997575247e2134e34459b6651202a51aa | 1,816 | py | Python | 100-199/130-139/135.py | dcragusa/LeetCode | 01c30de0832b378a1b054d80d1ea1d3f09a2abd3 | [
"MIT"
] | null | null | null | 100-199/130-139/135.py | dcragusa/LeetCode | 01c30de0832b378a1b054d80d1ea1d3f09a2abd3 | [
"MIT"
] | null | null | null | 100-199/130-139/135.py | dcragusa/LeetCode | 01c30de0832b378a1b054d80d1ea1d3f09a2abd3 | [
"MIT"
] | null | null | null | """
There are n children standing in a line. Each child is assigned a rating value given in the integer array ratings.
You are giving candies to these children subjected to the following requirements:
-Each child must have at least one candy.
-Children with a higher rating get more candies than their neighbors.
Return ... | 40.355556 | 119 | 0.710352 |
7b30e8a363d5cf8cf92d85616520e4e1fcbbb3fe | 2,488 | py | Python | tools/custom_apns.py | SwiftOS-DROID/android_vendor_swift | 9dabbd07f1e2e4e6e9f9dd2ebe610fcae26c58c6 | [
"Apache-2.0"
] | null | null | null | tools/custom_apns.py | SwiftOS-DROID/android_vendor_swift | 9dabbd07f1e2e4e6e9f9dd2ebe610fcae26c58c6 | [
"Apache-2.0"
] | null | null | null | tools/custom_apns.py | SwiftOS-DROID/android_vendor_swift | 9dabbd07f1e2e4e6e9f9dd2ebe610fcae26c58c6 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
#
# Copyright (C) 2018 The LineageOS Project
#
# 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 a... | 39.492063 | 84 | 0.575161 |
2b9db3025b0a30d6c648365c0679ccf244c87cc0 | 470 | py | Python | panel/models/ipywidget.py | sthagen/holoviz-panel | 9abae5ac78e55857ed209de06feae3439f2f533b | [
"BSD-3-Clause"
] | 601 | 2018-08-25T20:01:22.000Z | 2019-11-19T19:37:08.000Z | panel/models/ipywidget.py | sthagen/holoviz-panel | 9abae5ac78e55857ed209de06feae3439f2f533b | [
"BSD-3-Clause"
] | 626 | 2018-08-27T16:30:33.000Z | 2019-11-20T17:02:00.000Z | panel/models/ipywidget.py | sthagen/holoviz-panel | 9abae5ac78e55857ed209de06feae3439f2f533b | [
"BSD-3-Clause"
] | 73 | 2018-09-28T07:46:05.000Z | 2019-11-18T22:45:36.000Z | from bokeh.core.properties import Any
from bokeh.models.layouts import HTMLBox
class IPyWidget(HTMLBox):
bundle = Any()
def __init__(self, widget, **kwargs):
from ipywidgets import Widget, embed
super().__init__(**kwargs)
spec = widget.get_view_spec()
state = Widget.get_manag... | 29.375 | 77 | 0.676596 |
d8e2ed67370ef28901ebd93964328ab0a7a1f22f | 527 | py | Python | app/protostory/portal/api_views.py | mizikanikyuuri/theStory | 81591b4fc8168ca6c5705f1be9f48d63d99594fd | [
"BSD-3-Clause"
] | null | null | null | app/protostory/portal/api_views.py | mizikanikyuuri/theStory | 81591b4fc8168ca6c5705f1be9f48d63d99594fd | [
"BSD-3-Clause"
] | null | null | null | app/protostory/portal/api_views.py | mizikanikyuuri/theStory | 81591b4fc8168ca6c5705f1be9f48d63d99594fd | [
"BSD-3-Clause"
] | null | null | null | from portal.models import Article
from rest_framework import viewsets
from rest_framework import permissions
from . import serializers
class ArticleViewSet(viewsets.ModelViewSet):
"""
API endpoint that allows article to be viewed or edited.
"""
queryset = Article.objects.all().order_by('pub_date')
... | 31 | 64 | 0.770398 |
b0035039752f64089a83681d201b7a78247c9704 | 907 | py | Python | futuquant/examples/app/stock_alarm/data_acquisition.py | foundations/futuquant | ee4891e4c24f4eb670db359844aabcb08f81a141 | [
"Apache-2.0"
] | 5 | 2019-04-14T16:28:09.000Z | 2022-03-20T21:51:32.000Z | futuquant/examples/app/stock_alarm/data_acquisition.py | foundations/futuquant | ee4891e4c24f4eb670db359844aabcb08f81a141 | [
"Apache-2.0"
] | null | null | null | futuquant/examples/app/stock_alarm/data_acquisition.py | foundations/futuquant | ee4891e4c24f4eb670db359844aabcb08f81a141 | [
"Apache-2.0"
] | 1 | 2018-12-01T16:41:28.000Z | 2018-12-01T16:41:28.000Z | # -*- coding: utf-8 -*-
from futuquant import *
from . import data_strategy
class TickerTest(TickerHandlerBase):
""" 获取逐笔推送数据 """
def on_recv_rsp(self, rsp_pb):
"""数据响应回调函数"""
ret_code, content = super(TickerTest, self).parse_rsp_pb(rsp_pb)
if ret_code != RET_OK:
print("* ... | 26.676471 | 72 | 0.640573 |
19a6bff9c473cae253589b9f81fbee3ef17fe9a2 | 7,580 | py | Python | silasdk/client.py | xuru/Sila-Python | 12fef8886580327779d32cf7596dae4516b36c11 | [
"Apache-2.0"
] | null | null | null | silasdk/client.py | xuru/Sila-Python | 12fef8886580327779d32cf7596dae4516b36c11 | [
"Apache-2.0"
] | null | null | null | silasdk/client.py | xuru/Sila-Python | 12fef8886580327779d32cf7596dae4516b36c11 | [
"Apache-2.0"
] | null | null | null | import json
import logging
import time
import uuid
from typing import Optional
import requests
from .businessInformation import BusinessInformation
from .businessOperations import BusinessOperations
from .documents import Documents
from .transactions import Transaction
from .users import User
from .wallet import Wall... | 31.452282 | 123 | 0.584433 |
5774cf1bf545ca9a990179ad00a502ca12707eb8 | 650 | py | Python | main/dashboard/pages/paper/paper.py | apirzadeh1365/omic_project | dbde703340369cb900945dfccd47f688c2e5164e | [
"Apache-2.0"
] | null | null | null | main/dashboard/pages/paper/paper.py | apirzadeh1365/omic_project | dbde703340369cb900945dfccd47f688c2e5164e | [
"Apache-2.0"
] | null | null | null | main/dashboard/pages/paper/paper.py | apirzadeh1365/omic_project | dbde703340369cb900945dfccd47f688c2e5164e | [
"Apache-2.0"
] | null | null | null | """ This module contains the page that shows the research paper.
"""
__author__ = 'Djakim Latumalea'
__copyright__ = ['Djakim Latumalea', 'Azadeh Pirzadeh', 'Peter Riesebos', 'Kai Lin', 'Hossain Shahadat']
__license__ = 'Apache 2.0'
__version__ = '0.1'
from pathlib import Path
import panel as pn
from model.abstra... | 22.413793 | 104 | 0.704615 |
09ab956db97e8edd5fb7b0676898351af5dad739 | 533 | py | Python | app_root/setting_diff/setting_dev.py | fangMint/django_web | cf50df6c1a2358996620ac83ffa99b31472d3c07 | [
"AFL-3.0"
] | null | null | null | app_root/setting_diff/setting_dev.py | fangMint/django_web | cf50df6c1a2358996620ac83ffa99b31472d3c07 | [
"AFL-3.0"
] | null | null | null | app_root/setting_diff/setting_dev.py | fangMint/django_web | cf50df6c1a2358996620ac83ffa99b31472d3c07 | [
"AFL-3.0"
] | 1 | 2021-11-22T10:15:50.000Z | 2021-11-22T10:15:50.000Z | # ==================================
# Author : fang
# Time : 2020/4/24 上午11:47
# Email : zhen.fang@qdreamer.com
# File : setting_dev.py
# Software : PyCharm
# ==================================
from .setting_base import *
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
# D... | 25.380952 | 65 | 0.559099 |
ab47ef64037bdb2b080ad338b99f3f5ba6676d9a | 3,142 | py | Python | examples/full-screen/simple-demos/line-prefixes.py | gousaiyang/python-prompt-toolkit | 6237764658214af4c24633795d2571d2bd03375d | [
"BSD-3-Clause"
] | 4,028 | 2015-01-02T16:31:38.000Z | 2018-10-25T14:51:02.000Z | examples/full-screen/simple-demos/line-prefixes.py | gousaiyang/python-prompt-toolkit | 6237764658214af4c24633795d2571d2bd03375d | [
"BSD-3-Clause"
] | 709 | 2018-10-25T22:36:52.000Z | 2022-03-28T18:34:35.000Z | examples/full-screen/simple-demos/line-prefixes.py | gousaiyang/python-prompt-toolkit | 6237764658214af4c24633795d2571d2bd03375d | [
"BSD-3-Clause"
] | 399 | 2018-10-26T18:08:46.000Z | 2022-03-28T16:09:41.000Z | #!/usr/bin/env python
"""
An example of a BufferControl in a full screen layout that offers auto
completion.
Important is to make sure that there is a `CompletionsMenu` in the layout,
otherwise the completions won't be visible.
"""
from prompt_toolkit.application import Application
from prompt_toolkit.buffer import Bu... | 28.053571 | 82 | 0.68746 |
74b566665203e39a289d0835fcf1973dc0745ebc | 2,032 | py | Python | examples/object_storage_getnamespace_example.py | LaudateCorpus1/oci-python-sdk | b0d3ce629d5113df4d8b83b7a6502b2c5bfa3015 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | examples/object_storage_getnamespace_example.py | LaudateCorpus1/oci-python-sdk | b0d3ce629d5113df4d8b83b7a6502b2c5bfa3015 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | examples/object_storage_getnamespace_example.py | LaudateCorpus1/oci-python-sdk | b0d3ce629d5113df4d8b83b7a6502b2c5bfa3015 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | # coding: utf-8
# Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... | 46.181818 | 245 | 0.777067 |
5edbb1dde51b729e775a02e80d880c0de41e9946 | 2,357 | py | Python | doc/python-examples/HamCyc_z3.py | PraneethReddy-sc20prc/gralog | 34fdce1800264889f46d9e6c413fa0d6a936ddd4 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | doc/python-examples/HamCyc_z3.py | PraneethReddy-sc20prc/gralog | 34fdce1800264889f46d9e6c413fa0d6a936ddd4 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | doc/python-examples/HamCyc_z3.py | PraneethReddy-sc20prc/gralog | 34fdce1800264889f46d9e6c413fa0d6a936ddd4 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
############################################
# Copyright (c) 2012 Ganesh Gopalakrishnan ganesh@cs.utah.edu
#
# Check if the given graph has a Hamiltonian cycle.
#
# Author: Ganesh Gopalakrishnan ganesh@cs.utah.edu
############################################
#
# Edited by Roman Rabinovich in 201... | 29.098765 | 84 | 0.55961 |
772e34d6a0e5091a2e42b3c7d16a33124fa6b450 | 739 | py | Python | norta.py | DistributedSystemsGroup/schedsim | 24afeaf3205a73f7e1811dedb00ba84ce14ec292 | [
"Apache-2.0"
] | 2 | 2018-07-25T08:10:11.000Z | 2019-07-15T11:21:45.000Z | norta.py | DistributedSystemsGroup/schedsim | 24afeaf3205a73f7e1811dedb00ba84ce14ec292 | [
"Apache-2.0"
] | null | null | null | norta.py | DistributedSystemsGroup/schedsim | 24afeaf3205a73f7e1811dedb00ba84ce14ec292 | [
"Apache-2.0"
] | null | null | null | # Based on Lu et al.'s model for generating distributions with
# arbitrary coefficients
import math
import numpy
import scipy.stats
normal = scipy.stats.norm()
def generate(r, n, real_dist=normal, est_dist=None, eps=0.01):
rho = r
if est_dist is None:
est_dist = real_dist
low, high = 0, 1
wh... | 24.633333 | 62 | 0.538566 |
e054e96471a47cfb747cecdf9443328deab17663 | 1,034 | py | Python | 5002-code/outlier-detection.py | pranav-ust/hkust-materials | 46734e5edeb420c91d039ade7d046bef1e3a83c4 | [
"MIT"
] | 22 | 2019-01-09T08:34:36.000Z | 2022-03-25T10:48:16.000Z | 5002-code/outlier-detection.py | pranav-ust/hkust-materials | 46734e5edeb420c91d039ade7d046bef1e3a83c4 | [
"MIT"
] | null | null | null | 5002-code/outlier-detection.py | pranav-ust/hkust-materials | 46734e5edeb420c91d039ade7d046bef1e3a83c4 | [
"MIT"
] | 7 | 2019-03-11T13:44:41.000Z | 2021-09-04T06:20:12.000Z | from numpy import genfromtxt
import numpy as np
from scipy.spatial import distance_matrix
import heapq
k = 3
temp = genfromtxt('Q2Q3_input.csv', delimiter=',')
inp = temp[1:, 1:]
#create a distance matrix
mat = distance_matrix(inp, inp, p=2)
k_nearest = mat.argsort()[:, :k+1][:, k] #Indices of k-nearest neigbours
dis... | 24.046512 | 73 | 0.681818 |
6601e419e7305f0959de3ecf4f1216fc5279d2dd | 20,124 | py | Python | oauth2_provider/tests/test_authorization_code.py | pydanny/django-oauth-toolkit | bf9ce2837f9ae2be939ac00a23f348266b91325d | [
"BSD-2-Clause-FreeBSD"
] | 1 | 2019-07-25T23:15:39.000Z | 2019-07-25T23:15:39.000Z | oauth2_provider/tests/test_authorization_code.py | pydanny/django-oauth-toolkit | bf9ce2837f9ae2be939ac00a23f348266b91325d | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | oauth2_provider/tests/test_authorization_code.py | pydanny/django-oauth-toolkit | bf9ce2837f9ae2be939ac00a23f348266b91325d | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | from __future__ import unicode_literals
import json
from django.test import TestCase, RequestFactory
from django.core.urlresolvers import reverse
from django.utils import timezone
from ..compat import urlparse, parse_qs, urlencode, get_user_model
from ..models import Application, Grant
from ..settings import oauth2_... | 39.22807 | 110 | 0.639435 |
ce3eb27795a52a2274672d4665add5f8aefb177f | 1,668 | py | Python | mifgsm.py | JeromeFan/Adversarial-Attack | d332b7b3f3e99571cf818566a91451f7d4a8fa31 | [
"MIT"
] | null | null | null | mifgsm.py | JeromeFan/Adversarial-Attack | d332b7b3f3e99571cf818566a91451f7d4a8fa31 | [
"MIT"
] | null | null | null | mifgsm.py | JeromeFan/Adversarial-Attack | d332b7b3f3e99571cf818566a91451f7d4a8fa31 | [
"MIT"
] | null | null | null | import torch
import json
from baseAlgorithm import BaseAlgorithm
class MIFGSM(BaseAlgorithm):
def __init__(self, model, loss_fn, std):
super(MIFGSM, self).__init__(model, loss_fn, std)
with open('config.json') as config_file:
config = json.load(config_file)
self.normType = con... | 34.040816 | 100 | 0.576139 |
32180266987c017bd88fc889cbfa8c53c7304466 | 2,503 | py | Python | src/graph_notebook/sparql/query.py | joywa/graph-notebook | 2c55b4fb5b6fb3c3205d0786a45a9101a44288a4 | [
"ISC",
"Apache-2.0",
"CC0-1.0"
] | null | null | null | src/graph_notebook/sparql/query.py | joywa/graph-notebook | 2c55b4fb5b6fb3c3205d0786a45a9101a44288a4 | [
"ISC",
"Apache-2.0",
"CC0-1.0"
] | null | null | null | src/graph_notebook/sparql/query.py | joywa/graph-notebook | 2c55b4fb5b6fb3c3205d0786a45a9101a44288a4 | [
"ISC",
"Apache-2.0",
"CC0-1.0"
] | null | null | null | """
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
"""
import logging
from SPARQLWrapper import SPARQLWrapper
from graph_notebook.request_param_generator.call_and_get_response import call_and_get_response
logging.basicConfig()
logger = logging.getLogger("sparql... | 30.901235 | 119 | 0.676388 |
2386a68d6c53f61d80ecf2d48627f56de74ce9f3 | 2,205 | py | Python | plugins/CompleteLikeEclipse/scribes/edit/complete_like_eclipse/BufferMonitor.py | baverman/scribes-goodies | f6ebfe62e5103d5337929648109b4e610950bced | [
"MIT"
] | 1 | 2019-01-14T11:47:48.000Z | 2019-01-14T11:47:48.000Z | plugins/CompleteLikeEclipse/scribes/edit/complete_like_eclipse/BufferMonitor.py | Bhanditz/scribes-goodies | f6ebfe62e5103d5337929648109b4e610950bced | [
"MIT"
] | null | null | null | plugins/CompleteLikeEclipse/scribes/edit/complete_like_eclipse/BufferMonitor.py | Bhanditz/scribes-goodies | f6ebfe62e5103d5337929648109b4e610950bced | [
"MIT"
] | 1 | 2019-01-14T11:47:39.000Z | 2019-01-14T11:47:39.000Z | class Monitor(object):
def __init__(self, manager, editor):
editor.response()
self.__init_attributes(manager, editor)
self.__sigid1 = manager.connect("destroy", self.__destroy_cb)
self.__sigid2 = self.__buffer.connect("changed", self.__changed_cb)
self.__sigid3 = manager.connect("finished-indexing", self.__... | 31.056338 | 83 | 0.771882 |
8159cc630d76e7483938098d2668426f36177f29 | 197 | py | Python | exercisio61.py | bruno194/EXERCICIOS | cf7f00020515731031275a9b8d2696d7bf3bb5dc | [
"MIT"
] | 1 | 2022-02-25T13:28:46.000Z | 2022-02-25T13:28:46.000Z | exercisio61.py | bruno194/EXERCICIOS | cf7f00020515731031275a9b8d2696d7bf3bb5dc | [
"MIT"
] | null | null | null | exercisio61.py | bruno194/EXERCICIOS | cf7f00020515731031275a9b8d2696d7bf3bb5dc | [
"MIT"
] | null | null | null | pa = int(input('Informe o primeiro termo da PA: '))
razao = int(input('Informe a razaão da PA: '))
cont = 0
while cont < 10:
print(pa, end=' - ')
pa = pa + razao
cont += 1
print('Fim!') | 24.625 | 51 | 0.57868 |
94896a7e3c2033eec3dec6d358dc74bdf8932e6d | 3,298 | py | Python | home_application/migrations/0004_auto_20171221_1011.py | EthanHanFeng/bk_framework | 237c5a7e370674a1d20e9cb3034507e405a6042d | [
"Apache-2.0"
] | 1 | 2020-01-09T09:15:55.000Z | 2020-01-09T09:15:55.000Z | home_application/migrations/0004_auto_20171221_1011.py | EthanHanFeng/bk_framework | 237c5a7e370674a1d20e9cb3034507e405a6042d | [
"Apache-2.0"
] | null | null | null | home_application/migrations/0004_auto_20171221_1011.py | EthanHanFeng/bk_framework | 237c5a7e370674a1d20e9cb3034507e405a6042d | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import datetime
class Migration(migrations.Migration):
dependencies = [
('home_application', '0003_auto_20171220_1746'),
]
operations = [
migrations.CreateModel(
name='Au... | 40.716049 | 120 | 0.55943 |
b21de5887234ad5829a7b08bd395b6e1df724b3b | 65,104 | py | Python | pytext/torchscript/module.py | jeffreyliu3230/pytext | d7bdde7e69453ee38dcd6e5f950aa71b86995182 | [
"BSD-3-Clause"
] | null | null | null | pytext/torchscript/module.py | jeffreyliu3230/pytext | d7bdde7e69453ee38dcd6e5f950aa71b86995182 | [
"BSD-3-Clause"
] | null | null | null | pytext/torchscript/module.py | jeffreyliu3230/pytext | d7bdde7e69453ee38dcd6e5f950aa71b86995182 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
from typing import Any, Dict, List, Optional, Tuple
import torch
from pytext.config import ExportConfig
from pytext.torchscript.batchutils import (
input_size,
limit_list,
clip_list,
limit_listlist,
clip_l... | 35.382609 | 98 | 0.609747 |
a1cf8eedd877ecb939b47a9ee1ea9cba8ab2575b | 27,953 | py | Python | umap/views.py | brylie/umap | 508b63fce5a1f9d6f988b95bc7c7b635439112c0 | [
"WTFPL"
] | null | null | null | umap/views.py | brylie/umap | 508b63fce5a1f9d6f988b95bc7c7b635439112c0 | [
"WTFPL"
] | null | null | null | umap/views.py | brylie/umap | 508b63fce5a1f9d6f988b95bc7c7b635439112c0 | [
"WTFPL"
] | 3 | 2019-06-27T06:46:05.000Z | 2019-12-12T09:46:12.000Z | import hashlib
import json
import os
import re
import socket
import mimetypes
from django.conf import settings
from django.contrib import messages
from django.contrib.auth import logout as do_logout
from django.contrib.auth import get_user_model
from django.contrib.gis.measure import D
from django.core.paginator impor... | 33.041371 | 103 | 0.599005 |
c90bee6e9ab9be5d4a4047041882975d6f9f4c86 | 251 | py | Python | astr-119-hw-2/while.py | seanrtr3/astr-119 | 42db9a4ecf15a3d52298447e8f9f855a120c1f36 | [
"MIT"
] | null | null | null | astr-119-hw-2/while.py | seanrtr3/astr-119 | 42db9a4ecf15a3d52298447e8f9f855a120c1f36 | [
"MIT"
] | 5 | 2021-09-30T02:24:51.000Z | 2021-12-06T04:03:30.000Z | astr-119-hw-2/while.py | seanrtr3/astr-119 | 42db9a4ecf15a3d52298447e8f9f855a120c1f36 | [
"MIT"
] | null | null | null | i = 10
"""
while loops act on a conditional where, if true, whatever is after the
while statement will be executed. If false, the while loop will terminate
"""
while(i < 119):
print(i)
i += 10 # adds i + 10 and makes i that new number | 25.1 | 74 | 0.661355 |
eb23fb6356de1498ba0ed286a3227255c1a93b1d | 2,282 | py | Python | examples/snippets/evaluating_models/02_the_tasks_api.py | mercury-ml-team/mercury-ml | 8d27816490f0be46f871e889e4635e9223b7044c | [
"MIT"
] | 43 | 2019-02-01T15:22:09.000Z | 2020-02-21T12:51:42.000Z | examples/snippets/evaluating_models/02_the_tasks_api.py | mercury-ml-team/mercury-ml | 8d27816490f0be46f871e889e4635e9223b7044c | [
"MIT"
] | 17 | 2019-02-15T12:52:18.000Z | 2019-05-09T15:42:51.000Z | examples/snippets/evaluating_models/02_the_tasks_api.py | mercury-ml-team/mercury-ml | 8d27816490f0be46f871e889e4635e9223b7044c | [
"MIT"
] | 12 | 2019-02-02T16:48:10.000Z | 2019-12-16T15:40:15.000Z | # In this example, we'll assume that we already have a trained TensorFlow model (we'll simply load a small existing model)
# and that we have a "test" dataset consisting of NumpyDataWrappers. We'll then run several evaluations using the tasks
# api
from mercury_ml.common.source_reading.disk import read_pandas_data_set... | 39.344828 | 136 | 0.750657 |
017f08fe13f7bcdd7846334810e6e8b4a93d3ade | 921 | py | Python | src/request_utils.py | Matt-Gleich/Auto-Doc-Dockerfiles | 542351c9963ea556e893c27815a73662b9afafa1 | [
"MIT"
] | 3 | 2021-09-24T22:46:16.000Z | 2022-02-07T21:10:30.000Z | src/request_utils.py | Matt-Gleich/Auto-Doc-Dockerfiles | 542351c9963ea556e893c27815a73662b9afafa1 | [
"MIT"
] | null | null | null | src/request_utils.py | Matt-Gleich/Auto-Doc-Dockerfiles | 542351c9963ea556e893c27815a73662b9afafa1 | [
"MIT"
] | null | null | null | import requests
def get_image_meta(dockerID, imgName):
"""Do a get request to get the meta data files for the image on docker hub
Arguments:
dockerID {string} -- docker id, name of the owner
imgName {string} -- name of the image
Returns:
json -- response to GET request
... | 29.709677 | 103 | 0.605863 |
7309df0cefb3ee88c8e5a70a449fd3f782a4db3c | 24,026 | py | Python | server.py | naxIO/magebattle | b4191404d0ace82859ba358b2f85eddbe8567225 | [
"MIT"
] | 3 | 2015-10-26T07:52:09.000Z | 2020-12-08T16:22:19.000Z | server.py | Michaelangel007/Craft | 5e5351c749ceb85f8a006d7bf04008ab6a639553 | [
"MIT"
] | null | null | null | server.py | Michaelangel007/Craft | 5e5351c749ceb85f8a006d7bf04008ab6a639553 | [
"MIT"
] | 2 | 2016-10-31T10:30:21.000Z | 2021-08-30T11:41:23.000Z | from math import floor
from world import World
import Queue
import SocketServer
import datetime
import random
import re
import requests
import sqlite3
import sys
import threading
import time
import traceback
DEFAULT_HOST = '0.0.0.0'
DEFAULT_PORT = 4080
DB_PATH = 'craft.db'
LOG_PATH = 'log.txt'
CHUNK_SIZE = 32
BUFFER... | 36.40303 | 109 | 0.508865 |
5662234104ec43c1219701362ad76cc5b2d04863 | 4,146 | py | Python | corehq/apps/app_manager/management/commands/applications_with_add_ons.py | kkrampa/commcare-hq | d64d7cad98b240325ad669ccc7effb07721b4d44 | [
"BSD-3-Clause"
] | 1 | 2020-05-05T13:10:01.000Z | 2020-05-05T13:10:01.000Z | corehq/apps/app_manager/management/commands/applications_with_add_ons.py | kkrampa/commcare-hq | d64d7cad98b240325ad669ccc7effb07721b4d44 | [
"BSD-3-Clause"
] | 1 | 2019-12-09T14:00:14.000Z | 2019-12-09T14:00:14.000Z | corehq/apps/app_manager/management/commands/applications_with_add_ons.py | MaciejChoromanski/commcare-hq | fd7f65362d56d73b75a2c20d2afeabbc70876867 | [
"BSD-3-Clause"
] | 5 | 2015-11-30T13:12:45.000Z | 2019-07-01T19:27:07.000Z | # -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function
from __future__ import unicode_literals
import csv342 as csv
from django.core.management.base import BaseCommand, CommandError
from corehq import toggles
from corehq.apps.app_manager.models import Domain
from corehq.apps.toggle_ui.utils imp... | 48.209302 | 97 | 0.558611 |
f4aa801ead0f6902c83dc61f1624b3242a0cd6e2 | 1,459 | py | Python | posda/posdatools/histogram_tests/generate_scatter_data.py | UAMS-DBMI/PosdaTools | 7d33605da1b88e4787a1368dbecaffda1df95e5b | [
"Apache-2.0"
] | 6 | 2019-01-17T15:47:44.000Z | 2022-02-02T16:47:25.000Z | posda/posdatools/histogram_tests/generate_scatter_data.py | UAMS-DBMI/PosdaTools | 7d33605da1b88e4787a1368dbecaffda1df95e5b | [
"Apache-2.0"
] | 23 | 2016-06-08T21:51:36.000Z | 2022-03-02T08:11:44.000Z | posda/posdatools/histogram_tests/generate_scatter_data.py | UAMS-DBMI/PosdaTools | 7d33605da1b88e4787a1368dbecaffda1df95e5b | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
from subprocess import check_output
import codecs
import struct
import sys
filename = sys.argv[1]
out = check_output(['convert', filename, '-define', 'histogram:unique-colors=true', '-format', '%c', 'histogram:info:-'])
colormap = {}
for line in out.decode('utf8').split('\n'):
try:
... | 23.15873 | 121 | 0.612748 |
9113fbc071f9fa0db3136e6ed37f02fa553fa5e2 | 3,810 | py | Python | webapp/new_cron_job.py | motionbug/JAWA | 5b525b02cf3eb123c0e9d0e54286c3c92135b1c5 | [
"MIT"
] | 1 | 2019-11-20T15:22:02.000Z | 2019-11-20T15:22:02.000Z | webapp/new_cron_job.py | motionbug/JAWA | 5b525b02cf3eb123c0e9d0e54286c3c92135b1c5 | [
"MIT"
] | null | null | null | webapp/new_cron_job.py | motionbug/JAWA | 5b525b02cf3eb123c0e9d0e54286c3c92135b1c5 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# encoding: utf-8
import os
import json
from time import sleep
import re
from werkzeug import secure_filename
from flask import (Flask, request, render_template,
session, redirect, url_for, escape,
send_from_directory, Blueprint, abort)
from crontab import CronTab
new_cron = Blueprint('cron', __... | 25.065789 | 69 | 0.661417 |
093cf66a5dc10964237e2d3471e86f4a16851771 | 210 | py | Python | tests/functions/nested_functions2.py | chrivers/pyjaco | 8ad793dce34ab7aed3b973aae729d6a943a2381c | [
"MIT"
] | 38 | 2015-01-01T18:08:59.000Z | 2022-02-18T08:57:27.000Z | tests/functions/nested_functions2.py | chrivers/pyjaco | 8ad793dce34ab7aed3b973aae729d6a943a2381c | [
"MIT"
] | 1 | 2020-01-08T04:32:52.000Z | 2020-01-08T04:32:52.000Z | tests/functions/nested_functions2.py | chrivers/pyjaco | 8ad793dce34ab7aed3b973aae729d6a943a2381c | [
"MIT"
] | 12 | 2016-03-07T09:30:49.000Z | 2021-09-05T20:38:47.000Z | class Stuff(object):
def foo(self, x):
def bar(x):
def quux(x):
return x + 1
return quux(x) + 10
return bar(x) + 100
s = Stuff()
print s.foo(0)
| 13.125 | 31 | 0.438095 |
d7d2f3857dcfe730d4f62282f4f92e69a9ec87f7 | 18,598 | py | Python | ILI/parse_results.py | arodriguezca/DeepOutbreak | ee3de8aa4cab1abd5c3be2e85ed69bddc635cb6e | [
"MIT"
] | null | null | null | ILI/parse_results.py | arodriguezca/DeepOutbreak | ee3de8aa4cab1abd5c3be2e85ed69bddc635cb6e | [
"MIT"
] | null | null | null | ILI/parse_results.py | arodriguezca/DeepOutbreak | ee3de8aa4cab1abd5c3be2e85ed69bddc635cb6e | [
"MIT"
] | null | null | null | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
"""
Parses rmse results file by
Import file as dataframe
"""
#%%
def parse(regionName,date,suffix_results):
path_rmse="./rmse_results/"+str(regionName)+"_Future_"+date+suffix_results+".txt"
df = pd.read_csv(path_rmse, header=0)
... | 35.560229 | 169 | 0.690343 |
416423345e5cded9afce4c0083f4523434845484 | 2,604 | py | Python | legacy/ssd/config/pascal_voc_conf.py | FrancisLiang/models-1 | e14d5bc1ab36d0dd11977f27cff54605bf99c945 | [
"Apache-2.0"
] | 4 | 2020-01-04T13:15:02.000Z | 2021-07-21T07:50:02.000Z | legacy/ssd/config/pascal_voc_conf.py | FrancisLiang/models-1 | e14d5bc1ab36d0dd11977f27cff54605bf99c945 | [
"Apache-2.0"
] | 2 | 2019-06-26T03:21:49.000Z | 2019-09-19T09:43:42.000Z | legacy/ssd/config/pascal_voc_conf.py | FrancisLiang/models-1 | e14d5bc1ab36d0dd11977f27cff54605bf99c945 | [
"Apache-2.0"
] | 3 | 2019-10-31T07:18:49.000Z | 2020-01-13T03:18:39.000Z | from easydict import EasyDict as edict
import numpy as np
__C = edict()
cfg = __C
__C.TRAIN = edict()
__C.IMG_WIDTH = 300
__C.IMG_HEIGHT = 300
__C.IMG_CHANNEL = 3
__C.CLASS_NUM = 21
__C.BACKGROUND_ID = 0
# training settings
__C.TRAIN.LEARNING_RATE = 0.001 / 4
__C.TRAIN.MOMENTUM = 0.9
__C.TRAIN.BATCH_SIZE = 32
__C.T... | 28 | 48 | 0.722734 |
db3fd6e2b80fb773ab347ac32d47e748e04cdc7e | 8,353 | py | Python | smwds/api/models.py | rtx3/Salt-MWDS | 33d8b0abe65c74fba1a7be6838575603983c6c43 | [
"MIT"
] | 2 | 2016-08-26T06:20:04.000Z | 2016-08-26T12:50:02.000Z | smwds/api/models.py | rtx3/Salt-MWDS | 33d8b0abe65c74fba1a7be6838575603983c6c43 | [
"MIT"
] | null | null | null | smwds/api/models.py | rtx3/Salt-MWDS | 33d8b0abe65c74fba1a7be6838575603983c6c43 | [
"MIT"
] | 1 | 2017-03-31T05:20:10.000Z | 2017-03-31T05:20:10.000Z | # -*- coding: utf-8 -*-
from sqlalchemy import Column, desc, func
from sqlalchemy.orm import backref
from werkzeug.security import generate_password_hash, check_password_hash
from flask_login import UserMixin
from extensions import db, cache
from utils import get_current_time
from constants import USER, USER_ROLE, ... | 43.505208 | 87 | 0.638573 |
0ab15fd866999d7aa23228cbee6535fc933f7675 | 11,144 | py | Python | redfish-core/scripts/error_messages/error_messages.py | hyche/bmcweb | ebc692c9d14b59ffea43f6a83d3fc1467fe09aff | [
"Apache-2.0"
] | null | null | null | redfish-core/scripts/error_messages/error_messages.py | hyche/bmcweb | ebc692c9d14b59ffea43f6a83d3fc1467fe09aff | [
"Apache-2.0"
] | null | null | null | redfish-core/scripts/error_messages/error_messages.py | hyche/bmcweb | ebc692c9d14b59ffea43f6a83d3fc1467fe09aff | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2018 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | 33.465465 | 115 | 0.652279 |
d56d12529db8b8449502d33086fd30e4b3cd502f | 1,901 | py | Python | examples/series/series_getitem/series_getitem_series.py | dlee992/sdc | 1ebf55c00ef38dfbd401a70b3945e352a5a38b87 | [
"BSD-2-Clause"
] | 540 | 2017-06-19T16:29:24.000Z | 2019-05-21T09:30:07.000Z | examples/series/series_getitem/series_getitem_series.py | dlee992/sdc | 1ebf55c00ef38dfbd401a70b3945e352a5a38b87 | [
"BSD-2-Clause"
] | 389 | 2019-10-30T18:56:46.000Z | 2022-03-09T08:21:36.000Z | examples/series/series_getitem/series_getitem_series.py | dlee992/sdc | 1ebf55c00ef38dfbd401a70b3945e352a5a38b87 | [
"BSD-2-Clause"
] | 36 | 2017-06-19T16:29:15.000Z | 2019-04-26T09:22:39.000Z | # *****************************************************************************
# Copyright (c) 2020, Intel Corporation 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 sou... | 38.02 | 79 | 0.685955 |
aafddb0628a3c0e4065470a8d49a5d53ac5f6faf | 39,843 | py | Python | test/functional/test_framework/messages.py | Neomnf/NEOM | daf60c9ffc3f85d758c114f1e511d246a2fd178d | [
"MIT"
] | null | null | null | test/functional/test_framework/messages.py | Neomnf/NEOM | daf60c9ffc3f85d758c114f1e511d246a2fd178d | [
"MIT"
] | null | null | null | test/functional/test_framework/messages.py | Neomnf/NEOM | daf60c9ffc3f85d758c114f1e511d246a2fd178d | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2010 ArtForz -- public domain half-a-node
# Copyright (c) 2012 Jeff Garzik
# Copyright (c) 2010-2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""NEOM test fr... | 29.189011 | 262 | 0.597119 |
bbd994cabcb9c9167c1cb8dcb0004fcac3c0ed70 | 68 | py | Python | Taco-Cat/solution.py | adriandarian/binary-search-io | 461f016d668227e3220a15c9e9d2ee6decab384e | [
"MIT"
] | null | null | null | Taco-Cat/solution.py | adriandarian/binary-search-io | 461f016d668227e3220a15c9e9d2ee6decab384e | [
"MIT"
] | null | null | null | Taco-Cat/solution.py | adriandarian/binary-search-io | 461f016d668227e3220a15c9e9d2ee6decab384e | [
"MIT"
] | null | null | null | class Solution:
def solve(self, s):
return s == s[::-1]
| 17 | 27 | 0.514706 |
fc5b37662f1a0ea1c5d92aa1781f32ba0695b197 | 371 | py | Python | RasPi_Dev/ros_ws/build/third_packages/rgbd_launch/catkin_generated/pkg.installspace.context.pc.py | QianheYu/xtark_driver_dev | 1708888161cf20c0d1f45c99d0da4467d69c26c8 | [
"BSD-3-Clause"
] | 1 | 2022-03-11T03:31:15.000Z | 2022-03-11T03:31:15.000Z | RasPi_Dev/ros_ws/build/third_packages/rgbd_launch/catkin_generated/pkg.installspace.context.pc.py | bravetree/xtark_driver_dev | 1708888161cf20c0d1f45c99d0da4467d69c26c8 | [
"BSD-3-Clause"
] | null | null | null | RasPi_Dev/ros_ws/build/third_packages/rgbd_launch/catkin_generated/pkg.installspace.context.pc.py | bravetree/xtark_driver_dev | 1708888161cf20c0d1f45c99d0da4467d69c26c8 | [
"BSD-3-Clause"
] | null | null | null | # generated from catkin/cmake/template/pkg.context.pc.in
CATKIN_PACKAGE_PREFIX = ""
PROJECT_PKG_CONFIG_INCLUDE_DIRS = "".split(';') if "" != "" else []
PROJECT_CATKIN_DEPENDS = "".replace(';', ' ')
PKG_CONFIG_LIBRARIES_WITH_PREFIX = "".split(';') if "" != "" else []
PROJECT_NAME = "rgbd_launch"
PROJECT_SPACE_DIR = "/ho... | 41.222222 | 68 | 0.703504 |
215b0df57f7927a4f2cbdd37f581bcd8d15324e8 | 190 | py | Python | Semana_10/loro.py | eovallea3786/ProgramacionEAN20191 | 0f48a842195de29a3141d5012085e49d4b13a7d4 | [
"MIT"
] | null | null | null | Semana_10/loro.py | eovallea3786/ProgramacionEAN20191 | 0f48a842195de29a3141d5012085e49d4b13a7d4 | [
"MIT"
] | null | null | null | Semana_10/loro.py | eovallea3786/ProgramacionEAN20191 | 0f48a842195de29a3141d5012085e49d4b13a7d4 | [
"MIT"
] | null | null | null | dato = 2
while dato % 2 == 0:
dato = input(' ingresa un dato ')
print(dato)
try:
dato = int(dato)
except:
dato = 2
print('tu numero impar es', dato, 'chao') | 17.272727 | 41 | 0.526316 |
7748d2eddee92cb2ca3be50b79acbe6dd58982c2 | 453 | py | Python | solr-synonyms-api/synonyms/endpoints/__init__.py | ericminio/namex | 09da6b5f6476494d13ec2243934c51e0423340cd | [
"Apache-2.0"
] | null | null | null | solr-synonyms-api/synonyms/endpoints/__init__.py | ericminio/namex | 09da6b5f6476494d13ec2243934c51e0423340cd | [
"Apache-2.0"
] | null | null | null | solr-synonyms-api/synonyms/endpoints/__init__.py | ericminio/namex | 09da6b5f6476494d13ec2243934c51e0423340cd | [
"Apache-2.0"
] | null | null | null |
import flask_restplus
from . import synonyms
from . import probes
__all__ = ['api']
api = flask_restplus.Api(
version='1.0',
title='Synonyms API',
description='Retrieves the sets of synonyms for a given word.',
prefix='/api/v1',
)
# Remove the default namespace so that it doesn't show up in Swagg... | 19.695652 | 69 | 0.715232 |
173608260089112c605fcf18993d73a84ef3217c | 12,329 | py | Python | gunicorn/http/wsgi.py | sgillespiefuncaptcha/gunicorn | 7d82d3f8f1d7398eb3b00f9da4fd7189854aad43 | [
"MIT"
] | 2 | 2020-09-15T00:53:12.000Z | 2020-09-21T14:11:14.000Z | gunicorn/http/wsgi.py | wongjanwei/gunicorn | abc621beea0f91e6dbb10717631ed22629dd205b | [
"MIT"
] | null | null | null | gunicorn/http/wsgi.py | wongjanwei/gunicorn | abc621beea0f91e6dbb10717631ed22629dd205b | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -
#
# This file is part of gunicorn released under the MIT license.
# See the NOTICE for more information.
import io
import logging
import os
import re
import sys
from gunicorn.http.message import HEADER_RE
from gunicorn.http.errors import InvalidHeader, InvalidHeaderName
from gunicorn import SERV... | 31.291878 | 78 | 0.570768 |
a4ca92bc7617ce3a07d3a6f6d603013a19012703 | 9,126 | py | Python | nicos_mlz/panda/devices/guidefield.py | mlz-ictrl/nicos | a6de0bc194ba42e3dc04a033713b41b5499ba8e1 | [
"CC-BY-3.0",
"Apache-2.0",
"CC-BY-4.0"
] | 12 | 2019-11-06T15:40:36.000Z | 2022-01-01T16:23:00.000Z | nicos_mlz/panda/devices/guidefield.py | ess-dmsc/nicos | 755d61d403ff7123f804c45fc80c7ff4d762993b | [
"CC-BY-3.0",
"Apache-2.0",
"CC-BY-4.0"
] | 91 | 2020-08-18T09:20:26.000Z | 2022-02-01T11:07:14.000Z | nicos_mlz/panda/devices/guidefield.py | mlz-ictrl/nicos | a6de0bc194ba42e3dc04a033713b41b5499ba8e1 | [
"CC-BY-3.0",
"Apache-2.0",
"CC-BY-4.0"
] | 6 | 2020-01-11T10:52:30.000Z | 2022-02-25T12:35:23.000Z | # -*- coding: utf-8 -*-
# *****************************************************************************
# NICOS, the Networked Instrument Control System of the MLZ
# Copyright (c) 2009-2021 by the NICOS contributors (see AUTHORS)
#
# This program is free software; you can redistribute it and/or modify it under
# the t... | 38.669492 | 79 | 0.533202 |
31bf8cb52f77727a945b7ee764428bea77a0329a | 21,160 | py | Python | ocular_algorithm/old/0x01_BasicProgramStructure.py | DistinctWind/ManimProjects | 6318643afcc24574cbd9a0a45ff0d913d4711b13 | [
"MIT"
] | 2 | 2020-03-15T01:27:09.000Z | 2020-03-20T02:08:09.000Z | ocular_algorithm/old/0x01_BasicProgramStructure.py | DistinctWind/ManimProjects | 6318643afcc24574cbd9a0a45ff0d913d4711b13 | [
"MIT"
] | null | null | null | ocular_algorithm/old/0x01_BasicProgramStructure.py | DistinctWind/ManimProjects | 6318643afcc24574cbd9a0a45ff0d913d4711b13 | [
"MIT"
] | null | null | null | from manimlib.imports import *
class Alogorithm_introduction(Scene) :
def construct(self) :
title = Text('算法的特点', font='Dent', stroke_width=0).to_corner(UL)
self.play(Write(title))
self.wait(2)
effectiveness_text = Text('可行性', font='Dent', stroke_width=0).scale(0.6)
finiten... | 50.62201 | 128 | 0.617628 |
a730372ba7fa684e2b72b9f92326f43313af5b84 | 12,142 | py | Python | aristotle/lib/common.py | jermnelson/aristotle-library-apps | f742847cd20c5b5c3b46dd53dfc395a2e1caa240 | [
"Apache-2.0"
] | 2 | 2015-03-30T16:36:51.000Z | 2016-06-15T01:39:47.000Z | aristotle/lib/common.py | jermnelson/aristotle-library-apps | f742847cd20c5b5c3b46dd53dfc395a2e1caa240 | [
"Apache-2.0"
] | 2 | 2021-06-10T17:43:54.000Z | 2021-12-13T19:40:08.000Z | lib/common.py | jermnelson/FRBR-Redis-Datastore | d44af821536b82f5fafa5bed7a51fa86e9a92243 | [
"Apache-2.0"
] | 1 | 2015-11-08T00:40:11.000Z | 2015-11-08T00:40:11.000Z | """
:mod:`common` -- Common functions and classes for supporting FRBR Redis datastore
"""
__author__ = 'Jeremy Nelson'
import urllib2,os,logging
import sys,redis
import namespaces as ns
from lxml import etree
try:
import config
REDIS_HOST = config.REDIS_HOST
REDIS_PORT = config.REDIS_PORT
REDIS_DB = ... | 40.205298 | 106 | 0.524625 |
99f9a43ddf37e8f23966cc23f03b9282a5eab61e | 699 | py | Python | config/supervisor/kill_supervisor.py | fortranlee/docker-mediawiki | 09b6163d17d36fe3ea83f760053cf4b37215e53f | [
"MIT"
] | 68 | 2016-10-06T09:34:41.000Z | 2022-01-30T02:54:42.000Z | config/supervisor/kill_supervisor.py | fortranlee/docker-mediawiki | 09b6163d17d36fe3ea83f760053cf4b37215e53f | [
"MIT"
] | 26 | 2016-10-24T03:14:34.000Z | 2020-02-04T11:01:57.000Z | config/supervisor/kill_supervisor.py | fortranlee/docker-mediawiki | 09b6163d17d36fe3ea83f760053cf4b37215e53f | [
"MIT"
] | 53 | 2016-10-11T21:19:17.000Z | 2022-01-30T03:07:19.000Z | #!/usr/bin/env python
import sys
import os
import signal
def write_stdout(s):
sys.stdout.write(s)
sys.stdout.flush()
def write_stderr(s):
sys.stderr.write(s)
sys.stderr.flush()
def main():
while 1:
write_stdout('READY\n')
line = sys.stdin.readline()
write_stdout('This line kills sup... | 26.884615 | 78 | 0.596567 |
eabd111888116f911dac279ba699edec130940f0 | 467 | py | Python | articles/ch1_first-scraping.py | otakamrlw/corona_gis | 54332356e586cb3b9f3bb1d6f6a2badb56526fa4 | [
"MIT"
] | null | null | null | articles/ch1_first-scraping.py | otakamrlw/corona_gis | 54332356e586cb3b9f3bb1d6f6a2badb56526fa4 | [
"MIT"
] | null | null | null | articles/ch1_first-scraping.py | otakamrlw/corona_gis | 54332356e586cb3b9f3bb1d6f6a2badb56526fa4 | [
"MIT"
] | null | null | null | import time
from selenium import webdriver
# 仮想ブラウザ起動、URL先のサイトにアクセス
driver = webdriver.Chrome()
driver.get('https://www.google.com/')
time.sleep(2)
# サイト内から検索フォームを探す。
# Googleでは検索フォームのNameが「q」です。
el = driver.find_element_by_name("q")
# 検索フォームに文字を入力
el.send_keys('Qiitaで記事投稿楽しいぞ!!!')
time.sleep(2)
# 検索フォーム送信(Enter)
el... | 21.227273 | 64 | 0.775161 |
ef8afa3336aec5ab19ddfacc6c1abdf4693a72d4 | 5,247 | py | Python | docs/conf.py | ddunmire/python-bleson | bf6f4230b0e8b3377c54ee3b52213098cc52c2a8 | [
"MIT"
] | 103 | 2017-09-29T09:13:40.000Z | 2022-02-25T08:03:32.000Z | docs/conf.py | ddunmire/python-bleson | bf6f4230b0e8b3377c54ee3b52213098cc52c2a8 | [
"MIT"
] | 57 | 2017-11-06T04:48:16.000Z | 2021-05-24T11:02:22.000Z | docs/conf.py | ddunmire/python-bleson | bf6f4230b0e8b3377c54ee3b52213098cc52c2a8 | [
"MIT"
] | 30 | 2017-11-24T21:15:49.000Z | 2022-02-20T10:38:09.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Bleson documentation build configuration file, created by
# sphinx-quickstart on Tue Dec 5 06:02:49 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# aut... | 29.477528 | 79 | 0.67429 |
71c33b45b7b3f0e84877f20545218ab31edd6cc7 | 2,577 | py | Python | src/dataflake/fakeldap/utils.py | dataflake/dataflake.fakeldap | 37a2accd2ae41efd9be4ef8c873126f55be968e5 | [
"ZPL-2.1"
] | null | null | null | src/dataflake/fakeldap/utils.py | dataflake/dataflake.fakeldap | 37a2accd2ae41efd9be4ef8c873126f55be968e5 | [
"ZPL-2.1"
] | 4 | 2017-10-31T18:40:08.000Z | 2017-12-14T18:00:18.000Z | src/dataflake/fakeldap/utils.py | dataflake/dataflake.fakeldap | 37a2accd2ae41efd9be4ef8c873126f55be968e5 | [
"ZPL-2.1"
] | 4 | 2017-10-31T17:17:48.000Z | 2019-11-12T02:07:55.000Z | ##############################################################################
#
# Copyright (c) 2012-2021 Jens Vagelpohl 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 S... | 31.426829 | 79 | 0.565774 |
8e7efe9294983e0f9b5270c6293ebad94f83281c | 5,251 | py | Python | pyelit/Geoparsing/preprocessing_gazetteer.py | Rickecr/PyElit | 83b7d5952b587388b119f7f42738cf69ff53a892 | [
"MIT"
] | 2 | 2020-06-20T15:30:57.000Z | 2020-07-02T16:14:34.000Z | pyelit/Geoparsing/preprocessing_gazetteer.py | Rickecr/PyElit | 83b7d5952b587388b119f7f42738cf69ff53a892 | [
"MIT"
] | 21 | 2019-10-22T12:38:29.000Z | 2020-07-24T22:24:35.000Z | pyelit/Geoparsing/preprocessing_gazetteer.py | richecr/PyElit | 83b7d5952b587388b119f7f42738cf69ff53a892 | [
"MIT"
] | 2 | 2019-10-18T10:39:09.000Z | 2020-07-03T19:22:59.000Z | from plpygis import Geometry
import csv
import sys
# Increasing the limit size of the CSV.
maxInt = sys.maxsize
csv.field_size_limit(maxInt)
def convert_geometry_point(geometry):
"""
Pre-processing function that turns a code into geometry(Point)
for a list of floats.
Params:
----------
geome... | 25.004762 | 88 | 0.557227 |
82233767175037cd8d4aaf8b6ac0994863915475 | 2,976 | py | Python | findMiniPath2.py | NguyenDucTrung123/Bellman-Ford-Algorithm | 7cc0916d903e54ce8407f3467b26d0a2729b8877 | [
"MIT"
] | null | null | null | findMiniPath2.py | NguyenDucTrung123/Bellman-Ford-Algorithm | 7cc0916d903e54ce8407f3467b26d0a2729b8877 | [
"MIT"
] | null | null | null | findMiniPath2.py | NguyenDucTrung123/Bellman-Ford-Algorithm | 7cc0916d903e54ce8407f3467b26d0a2729b8877 | [
"MIT"
] | null | null | null | import numpy as np
from collections import defaultdict
#a class to represent a vertex in a graph as a node.
class Node(object):
def __init__(self, vertex_name, dist = float('inf'), trace = None):
self.vertex_name = vertex_name
self.dist = dist
self.trace = trace
pass
"""
class Vertex(objec... | 27.813084 | 110 | 0.612567 |
7e6f9ca2155325a66b92153cfef0ca503a17e2b9 | 198 | py | Python | CONTENT/DS-n-Algos/ALGO/__PYTHON/exists_in.py | Web-Dev-Collaborative/DS-ALGO-OFFICIAL | 6d7195d33c28a0fe22f12231efffb39f4bf05c97 | [
"Apache-2.0"
] | 11 | 2021-02-18T04:53:44.000Z | 2022-01-16T10:57:39.000Z | CONTENT/DS-n-Algos/ALGO/__PYTHON/exists_in.py | Web-Dev-Collaborative/DS-ALGO-OFFICIAL | 6d7195d33c28a0fe22f12231efffb39f4bf05c97 | [
"Apache-2.0"
] | 162 | 2021-03-09T01:52:11.000Z | 2022-03-12T01:09:07.000Z | CONTENT/DS-n-Algos/ALGO/__PYTHON/exists_in.py | Web-Dev-Collaborative/DS-ALGO-OFFICIAL | 6d7195d33c28a0fe22f12231efffb39f4bf05c97 | [
"Apache-2.0"
] | 8 | 2021-02-18T05:12:34.000Z | 2022-03-06T19:02:14.000Z | def find(arr, search, n):
for i in range(n):
if arr[i] == search:
return True
break
arr = [1, 2, 3, 4, 5, 6]
search = 4
print(find(arr, search, 6))
| 16.5 | 29 | 0.459596 |
db54f5904c79cf7a23de44ceae0d7a076a1b68d3 | 22,244 | py | Python | pyslate/pyslate.py | GreeKpl/pystlate | 57b62d8e3f2f51770eeaa3bd7bfde4df9f574690 | [
"MIT"
] | 4 | 2016-03-12T05:47:52.000Z | 2020-06-02T00:41:16.000Z | pyslate/pyslate.py | alchrabas/pyslate | 57b62d8e3f2f51770eeaa3bd7bfde4df9f574690 | [
"MIT"
] | null | null | null | pyslate/pyslate.py | alchrabas/pyslate | 57b62d8e3f2f51770eeaa3bd7bfde4df9f574690 | [
"MIT"
] | 1 | 2015-03-16T21:22:13.000Z | 2015-03-16T21:22:13.000Z | import copy
import datetime
import numbers
import six
from .config import DefaultConfig
from .locales import LOCALES
from .parser import InnerTagField, VariableField, SwitchField, PyslateException
class Pyslate(object):
"""
Main class responsible for all the translation and localization. When constructed it'... | 44.577154 | 151 | 0.663864 |
2ab0f2625565b08d3d45a51addf5b58218dbdb3a | 89,932 | py | Python | tests/hazmat/primitives/test_rsa.py | dish59742/cryptography | da8d490ed24f247769d3a67ed694debf659909b2 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | tests/hazmat/primitives/test_rsa.py | dish59742/cryptography | da8d490ed24f247769d3a67ed694debf659909b2 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | tests/hazmat/primitives/test_rsa.py | dish59742/cryptography | da8d490ed24f247769d3a67ed694debf659909b2 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | # This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
import binascii
import itertools
import os
import pytest
from cryptography.exceptions import (
AlreadyFinalized,
InvalidSignatur... | 36.365548 | 79 | 0.582396 |
ca3125d9f10ad165a8fffb965d3cd33bb6b44fc6 | 413 | py | Python | data/silesia_gen.py | nataliepopescu/osdi21-artifact | 6a268c90a8ce449256b5c290caeb7e0e3b9d7e5c | [
"MIT"
] | null | null | null | data/silesia_gen.py | nataliepopescu/osdi21-artifact | 6a268c90a8ce449256b5c290caeb7e0e3b9d7e5c | [
"MIT"
] | null | null | null | data/silesia_gen.py | nataliepopescu/osdi21-artifact | 6a268c90a8ce449256b5c290caeb7e0e3b9d7e5c | [
"MIT"
] | null | null | null | import brotli
import random
import string
with open('./silesia.tar', 'rb') as f:
decoded = f.read()
print("Generating silesia-5...")
with open('silesia-5.brotli', 'wb') as f:
compressed= brotli.compress(decoded, quality=5)
f.write(compressed)
print("Generating silesia-11...")
with open('silesia-11.brotl... | 22.944444 | 52 | 0.687651 |
dae9981e5287a3e551d0cd357768feb7f39cbf51 | 499 | py | Python | js_showcase/migrations/0005_showcaseslide_layout.py | compoundpartners/js-scrollstory | caa7cf274315cf3e7bd005535dbf570f4b9d74f9 | [
"BSD-3-Clause"
] | null | null | null | js_showcase/migrations/0005_showcaseslide_layout.py | compoundpartners/js-scrollstory | caa7cf274315cf3e7bd005535dbf570f4b9d74f9 | [
"BSD-3-Clause"
] | null | null | null | js_showcase/migrations/0005_showcaseslide_layout.py | compoundpartners/js-scrollstory | caa7cf274315cf3e7bd005535dbf570f4b9d74f9 | [
"BSD-3-Clause"
] | null | null | null | # Generated by Django 2.2.10 on 2020-04-22 04:26
from django.db import migrations, models
import django.db.models.deletion
import js_showcase.models
class Migration(migrations.Migration):
dependencies = [
('js_showcase', '0004_showcasearticle'),
]
operations = [
migrations.AddField(
... | 23.761905 | 97 | 0.647295 |
d44d484b1bc20e7081e915f15e72b049d1ed73b5 | 2,389 | py | Python | src/deutsch_jozsa.py | qcc4cp/qcc | 63227bbe36251b6f0bb3f78f2233337edcef547e | [
"Apache-2.0"
] | 10 | 2021-01-25T01:47:32.000Z | 2022-03-23T09:18:35.000Z | src/deutsch_jozsa.py | qcc4cp/qcc | 63227bbe36251b6f0bb3f78f2233337edcef547e | [
"Apache-2.0"
] | 17 | 2021-03-19T13:22:27.000Z | 2021-09-15T15:23:18.000Z | src/deutsch_jozsa.py | qcc4cp/qcc | 63227bbe36251b6f0bb3f78f2233337edcef547e | [
"Apache-2.0"
] | 5 | 2021-01-25T05:45:45.000Z | 2022-02-06T16:26:00.000Z | # python3
"""Example: Deutsch-Jozsa Algorithm."""
import math
from typing import Callable, List
from absl import app
import numpy as np
from src.lib import helper
from src.lib import ops
from src.lib import state
# Functions are either constant or balanced. Distinguish via strings.
exp_constant = 'constant'
exp_bal... | 29.134146 | 69 | 0.668481 |
bc4ff2c9560b378f5894ed7a0418a379bf84727b | 13,671 | py | Python | repo2docker/buildpacks/r.py | NITTYG/repo2docker | 020160baf01c9a0e339594213801b53a9677fdde | [
"BSD-3-Clause"
] | 1 | 2022-01-06T09:47:35.000Z | 2022-01-06T09:47:35.000Z | repo2docker/buildpacks/r.py | NITTYG/repo2docker | 020160baf01c9a0e339594213801b53a9677fdde | [
"BSD-3-Clause"
] | null | null | null | repo2docker/buildpacks/r.py | NITTYG/repo2docker | 020160baf01c9a0e339594213801b53a9677fdde | [
"BSD-3-Clause"
] | null | null | null | import re
import os
import datetime
import requests
from distutils.version import LooseVersion as V
from .python import PythonBuildPack
from ._r_base import rstudio_base_scripts, DEVTOOLS_VERSION, IRKERNEL_VERSION
class RBuildPack(PythonBuildPack):
"""
Setup R for use with a repository
This sets up R +... | 35.509091 | 152 | 0.529003 |
b25fab3c3df706997c445afa090cfab7fde01408 | 4,656 | py | Python | hitbtc_wss/utils.py | L-Warlok/hitbtc | a9a2b0784d8b5b003c2d8835053eae3afa0a0554 | [
"MIT"
] | 1 | 2019-06-01T09:11:47.000Z | 2019-06-01T09:11:47.000Z | hitbtc_wss/utils.py | L-Warlok/hitbtc | a9a2b0784d8b5b003c2d8835053eae3afa0a0554 | [
"MIT"
] | null | null | null | hitbtc_wss/utils.py | L-Warlok/hitbtc | a9a2b0784d8b5b003c2d8835053eae3afa0a0554 | [
"MIT"
] | null | null | null | """
Message templates to log when handling responses to requests that are SUCCESFUL.
Failed requests are logged using the error code contained in the response and its related message.
"""
resp_get_currency = '{currency}:\n' \
'\t{fullName}({id}):' \
'\tIs a cryptocurrency: {crypto}\n' \
... | 48 | 135 | 0.605241 |
dbb6836cdd828c6fa4d8d37c47ad4912a5c4c747 | 2,518 | py | Python | integration_tests/base_routes.py | patchgamestudio/robyn | 1576ea5273050bfa52ef3d7fa458f0ddf5427977 | [
"BSD-2-Clause"
] | null | null | null | integration_tests/base_routes.py | patchgamestudio/robyn | 1576ea5273050bfa52ef3d7fa458f0ddf5427977 | [
"BSD-2-Clause"
] | null | null | null | integration_tests/base_routes.py | patchgamestudio/robyn | 1576ea5273050bfa52ef3d7fa458f0ddf5427977 | [
"BSD-2-Clause"
] | null | null | null | from robyn import Robyn, static_file, jsonify, WS
import asyncio
import os
import pathlib
app = Robyn(__file__)
websocket = WS(app, "/web_socket")
i = -1
@websocket.on("message")
async def connect():
global i
i+=1
if i==0:
return "Whaaat??"
elif i==1:
return "Whooo??"
elif i==2:
... | 21.706897 | 122 | 0.666402 |
a6c2228723f6ace926422e6b7875b832495ba0b8 | 403 | py | Python | 10. Satndard rules/LBYL.py | riyabhatia26/Python-Programming | 2882728982c15c3b6380033eb2e90761b538dd93 | [
"MIT"
] | 3 | 2020-08-07T04:33:19.000Z | 2021-10-06T08:58:01.000Z | 10. Satndard rules/LBYL.py | riyabhatia26/Python-Programming | 2882728982c15c3b6380033eb2e90761b538dd93 | [
"MIT"
] | null | null | null | 10. Satndard rules/LBYL.py | riyabhatia26/Python-Programming | 2882728982c15c3b6380033eb2e90761b538dd93 | [
"MIT"
] | 2 | 2021-10-06T08:58:05.000Z | 2021-10-06T09:46:42.000Z | '''
Perpare for failure
1. Check for preconditions
2. Prepare for consequences
LBYL: Look before you leap
EAFP: Easier to Ask Forgiveness than Permission
'''
# Precessing a file
# Processing details are not important. process_file() opens a file and reads it
# Process file: LBYL
import os
p= '/path/to/datafile.dat... | 18.318182 | 80 | 0.727047 |
0413edce4e1832f34ae33fc1c13f88fd85099ddb | 2,552 | py | Python | zerver/webhooks/deskdotcom/tests.py | gnprice/zulip | f29a1918f3cd3795f6ded3dc174472ef0fde3973 | [
"Apache-2.0"
] | null | null | null | zerver/webhooks/deskdotcom/tests.py | gnprice/zulip | f29a1918f3cd3795f6ded3dc174472ef0fde3973 | [
"Apache-2.0"
] | 6 | 2020-09-05T21:07:41.000Z | 2021-12-02T17:56:37.000Z | zerver/webhooks/deskdotcom/tests.py | gnprice/zulip | f29a1918f3cd3795f6ded3dc174472ef0fde3973 | [
"Apache-2.0"
] | 1 | 2021-01-07T23:27:52.000Z | 2021-01-07T23:27:52.000Z | # -*- coding: utf-8 -*-
from typing import Text
from zerver.lib.test_classes import WebhookTestCase
# Tests for the Desk.com webhook integration.
#
# The stream name must be provided in the url-encoded test fixture data,
# and must match STREAM_NAME set here.
#
# Example:
#
# stream=deskdotcom&topic=static%20text%20n... | 42.533333 | 114 | 0.654389 |
3f99928d2ab6d5409186bc36346ad18dbf47c7b9 | 1,486 | py | Python | cdk/stacks/sample_kinesis_stream_producer/sample_kinesis_stream_producer_stack.py | aws-samples/amazon-kinesis-timestream-grafana | 5be9be17fb17ef4ea3666f4dad39623cf1d954df | [
"MIT-0"
] | 19 | 2021-01-13T03:30:37.000Z | 2022-03-30T20:06:37.000Z | cdk/stacks/sample_kinesis_stream_producer/sample_kinesis_stream_producer_stack.py | aws-samples/amazon-kinesis-timestream-grafana | 5be9be17fb17ef4ea3666f4dad39623cf1d954df | [
"MIT-0"
] | null | null | null | cdk/stacks/sample_kinesis_stream_producer/sample_kinesis_stream_producer_stack.py | aws-samples/amazon-kinesis-timestream-grafana | 5be9be17fb17ef4ea3666f4dad39623cf1d954df | [
"MIT-0"
] | 4 | 2021-04-01T06:20:58.000Z | 2022-02-01T14:35:03.000Z | # Copyright Amazon.com, Inc. and its affiliates. All Rights Reserved.
# SPDX-License-Identifier: MIT-0
from aws_cdk import (
aws_events_targets,
aws_kinesis,
aws_lambda,
aws_lambda_python,
core
)
from aws_cdk.aws_events import Rule, Schedule, RuleTargetInput
from aws_cdk.core import Duration
clas... | 43.705882 | 128 | 0.58681 |
7e77a8978bf3353ab86fa53d251dc70138f26611 | 480 | py | Python | plugins/iq_show.py | mathiasertl/poezio | 49b785d5be879353c6b1a5f98cfe173d3c8fff15 | [
"Zlib"
] | null | null | null | plugins/iq_show.py | mathiasertl/poezio | 49b785d5be879353c6b1a5f98cfe173d3c8fff15 | [
"Zlib"
] | null | null | null | plugins/iq_show.py | mathiasertl/poezio | 49b785d5be879353c6b1a5f98cfe173d3c8fff15 | [
"Zlib"
] | null | null | null | """
Show the exchanged IQs (useful for debugging).
"""
from poezio.plugin import BasePlugin
from slixmpp.xmlstream.matcher import StanzaPath
from slixmpp.xmlstream.handler import Callback
class Plugin(BasePlugin):
def init(self):
self.core.xmpp.register_handler(Callback('Iq_show', StanzaPath('iq'), self.h... | 26.666667 | 94 | 0.710417 |
96366dedb54caaec1ed32567371a894823a01c39 | 638 | py | Python | mytracks_from_gdrive.py | dogwynn/jackson_zoo | 82ec1119e514b2d0d8f9f084f4fab7bb61317bb3 | [
"CC0-1.0"
] | null | null | null | mytracks_from_gdrive.py | dogwynn/jackson_zoo | 82ec1119e514b2d0d8f9f084f4fab7bb61317bb3 | [
"CC0-1.0"
] | null | null | null | mytracks_from_gdrive.py | dogwynn/jackson_zoo | 82ec1119e514b2d0d8f9f084f4fab7bb61317bb3 | [
"CC0-1.0"
] | null | null | null | import os
import gdrive
import mytracks
def get_gdrive_mytracks():
root = gdrive.get_file_graph()
kml = []
for rnode, dirs, files in gdrive.walk(root,'/Shared Data'):
kml.extend(f for f in files if (f.title.endswith('.kmz') or
f.title.endswith('.kmz')))
... | 24.538462 | 67 | 0.590909 |
9197a90b04322b1edda688eb72f1250994615a5e | 4,305 | py | Python | dbpn_v1.py | lizatish/My_CNN | b13818bcce2f8a3697d20e34157e3dce53f953ee | [
"MIT"
] | null | null | null | dbpn_v1.py | lizatish/My_CNN | b13818bcce2f8a3697d20e34157e3dce53f953ee | [
"MIT"
] | null | null | null | dbpn_v1.py | lizatish/My_CNN | b13818bcce2f8a3697d20e34157e3dce53f953ee | [
"MIT"
] | null | null | null | import os
import torch.nn as nn
import torch.optim as optim
from base_networks import *
from torchvision.transforms import *
class Net(nn.Module):
def __init__(self, num_channels, base_filter, feat, num_stages, scale_factor):
super(Net, self).__init__()
if scale_factor == 2:
kernel = ... | 35.286885 | 113 | 0.587456 |
1632c1ac404f64ccdb961fc085948e51c059590a | 792 | py | Python | bin/annotateBibFile.py | kylelang/missingDataReadings | e5c6ab5d19364937c34412f136d0f69de4680f2d | [
"MIT"
] | 1 | 2019-11-15T08:55:52.000Z | 2019-11-15T08:55:52.000Z | bin/annotateBibFile.py | kylelang/missingDataReadings | e5c6ab5d19364937c34412f136d0f69de4680f2d | [
"MIT"
] | null | null | null | bin/annotateBibFile.py | kylelang/missingDataReadings | e5c6ab5d19364937c34412f136d0f69de4680f2d | [
"MIT"
] | 1 | 2020-10-07T08:39:25.000Z | 2020-10-07T08:39:25.000Z | ### Title: Annotate BibTex file
### Author: Kyle M. Lang
### Created: 2019-10-29
### Modified: 2019-11-04
### USAGE:
### python annotateBibFile.py RAW_FILE ANN_FILE OUT_FILE
### ARGS:
### RAW_FILE = Absolute or relative path (including file name and extension)
### to the file containing the raw... | 30.461538 | 78 | 0.67803 |
06cff22a0093b59d0d5743b9f4b1d43a639cad21 | 11,168 | py | Python | drf_extra_fields/fields.py | Wasa22/drf-extra-fields | a83009f42eef1510dfd024b5f6888266558524da | [
"Apache-2.0"
] | null | null | null | drf_extra_fields/fields.py | Wasa22/drf-extra-fields | a83009f42eef1510dfd024b5f6888266558524da | [
"Apache-2.0"
] | null | null | null | drf_extra_fields/fields.py | Wasa22/drf-extra-fields | a83009f42eef1510dfd024b5f6888266558524da | [
"Apache-2.0"
] | null | null | null | import base64
import binascii
import imghdr
import io
import uuid
from django.core.exceptions import ValidationError
from django.core.files.uploadedfile import SimpleUploadedFile
from django.core.files.storage import default_storage
from django.utils.translation import gettext_lazy as _
from rest_framework.fields impo... | 33.638554 | 120 | 0.657056 |
28f013c548da145c73fa97c06ffd7c38500fa27b | 1,961 | py | Python | ssseg/cfgs/annnet/cfgs_cityscapes_resnet101os8.py | nianjiuhuiyi/sssegmentation | 4fc12ea7b80fe83170b6d3da0826e53a99ef5325 | [
"MIT"
] | 411 | 2020-10-22T02:24:57.000Z | 2022-03-31T11:19:17.000Z | ssseg/cfgs/annnet/cfgs_cityscapes_resnet101os8.py | nianjiuhuiyi/sssegmentation | 4fc12ea7b80fe83170b6d3da0826e53a99ef5325 | [
"MIT"
] | 24 | 2020-12-21T03:53:54.000Z | 2022-03-17T06:50:00.000Z | ssseg/cfgs/annnet/cfgs_cityscapes_resnet101os8.py | nianjiuhuiyi/sssegmentation | 4fc12ea7b80fe83170b6d3da0826e53a99ef5325 | [
"MIT"
] | 59 | 2020-12-04T03:40:12.000Z | 2022-03-30T09:12:47.000Z | '''define the config file for cityscapes and resnet101os8'''
import os
from .base_cfg import *
# modify dataset config
DATASET_CFG = DATASET_CFG.copy()
DATASET_CFG.update({
'type': 'cityscapes',
'rootdir': os.path.join(os.getcwd(), 'CityScapes'),
})
DATASET_CFG['train']['aug_opts'] = [
('Resize', {'output... | 30.169231 | 106 | 0.654258 |
b61f9156fac150f760b016abece30bc74162db2a | 1,087 | py | Python | test/multi_prompt_minmax.py | temptitle/big-sleep | ac7e62a45829b3d8ab82aafb62db5475d7f644da | [
"MIT"
] | null | null | null | test/multi_prompt_minmax.py | temptitle/big-sleep | ac7e62a45829b3d8ab82aafb62db5475d7f644da | [
"MIT"
] | null | null | null | test/multi_prompt_minmax.py | temptitle/big-sleep | ac7e62a45829b3d8ab82aafb62db5475d7f644da | [
"MIT"
] | null | null | null | import time
import shutil
import torch
from big_sleep import Imagine
terminate = False
def signal_handling(signum,frame):
global terminate
terminate = True
num_attempts = 4
for attempt in range(num_attempts):
dream = Imagine(
text = "an armchair in the form of pikachu\\an armchair imitating pikac... | 24.155556 | 93 | 0.599816 |
81cce48c0621f130b6f700de74d9595dad57836b | 63,830 | py | Python | test/integration/component/test_usage.py | lsimons/cloudstack | a93f8ae19ff2448af5e5e51c2db8c425ce677ec8 | [
"Apache-2.0"
] | 1 | 2015-02-06T04:17:11.000Z | 2015-02-06T04:17:11.000Z | test/integration/component/test_usage.py | disller/cloudstack | 794ee6929d078fd919842f2c1f55156f133d7934 | [
"Apache-2.0"
] | 6 | 2020-11-16T20:44:23.000Z | 2022-02-01T01:06:16.000Z | test/integration/component/test_usage.py | disller/cloudstack | 794ee6929d078fd919842f2c1f55156f133d7934 | [
"Apache-2.0"
] | 1 | 2019-12-31T08:00:00.000Z | 2019-12-31T08:00:00.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... | 39.304187 | 120 | 0.459079 |
0548652057751cc76c781202176a5eedab9aa67b | 4,649 | py | Python | src/launch/scenario_test_runner_launch/launch/autoware_auto.launch.py | rxnew/AutowareAuto | d5d3ef0c6702672863177d669620f0da9b8f2c28 | [
"Apache-2.0"
] | null | null | null | src/launch/scenario_test_runner_launch/launch/autoware_auto.launch.py | rxnew/AutowareAuto | d5d3ef0c6702672863177d669620f0da9b8f2c28 | [
"Apache-2.0"
] | null | null | null | src/launch/scenario_test_runner_launch/launch/autoware_auto.launch.py | rxnew/AutowareAuto | d5d3ef0c6702672863177d669620f0da9b8f2c28 | [
"Apache-2.0"
] | 2 | 2021-09-27T06:19:07.000Z | 2021-09-28T08:18:09.000Z | # Copyright 2021, The Autoware Foundation
#
# 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... | 35.761538 | 99 | 0.680146 |
4b8b0609f7f8e612b76049686408dc985b806cb1 | 82 | py | Python | otp_prng/main.py | alitoxSB/CryptographyCourse | 91dc5f5da9ce69a2998abd9acc3d946c218ea3df | [
"MIT"
] | null | null | null | otp_prng/main.py | alitoxSB/CryptographyCourse | 91dc5f5da9ce69a2998abd9acc3d946c218ea3df | [
"MIT"
] | null | null | null | otp_prng/main.py | alitoxSB/CryptographyCourse | 91dc5f5da9ce69a2998abd9acc3d946c218ea3df | [
"MIT"
] | null | null | null | from system_logic.logic import menu as menu
if __name__ == '__main__':
menu()
| 20.5 | 43 | 0.719512 |
6085ca3b666758b345704a3a793124e55aacd7b7 | 641 | py | Python | app.py | jrichardson12/portfolio | aad2d2cd9f2bdfceed831652b83bfed7a910d01e | [
"MIT"
] | null | null | null | app.py | jrichardson12/portfolio | aad2d2cd9f2bdfceed831652b83bfed7a910d01e | [
"MIT"
] | null | null | null | app.py | jrichardson12/portfolio | aad2d2cd9f2bdfceed831652b83bfed7a910d01e | [
"MIT"
] | null | null | null | from flask import Flask, render_template
from flask_material import Material
app = Flask(__name__)
Material(app)
@app.route('/')
def index():
return render_template('splash/splash.html')
@app.route('/about')
def about():
return render_template('about/about.html')
@app.route('/portfolio')
def portfolio():
... | 21.366667 | 61 | 0.714509 |
e8690ee14bc31f6aba4f97cc80696afbfaa50965 | 5,027 | py | Python | data/loader.py | pnarsina/w266_final | 113cca1a3db752284e2c41f29b9e5757839b6843 | [
"Apache-2.0"
] | null | null | null | data/loader.py | pnarsina/w266_final | 113cca1a3db752284e2c41f29b9e5757839b6843 | [
"Apache-2.0"
] | null | null | null | data/loader.py | pnarsina/w266_final | 113cca1a3db752284e2c41f29b9e5757839b6843 | [
"Apache-2.0"
] | null | null | null | """
Data loader for TACRED json files.
"""
import json
import random
import torch
import numpy as np
from utils import constant, helper, vocab
class DataLoader(object):
"""
Load data from json files, preprocess and prepare batches.
"""
def __init__(self, filename, batch_size, opt, vocab, evaluation=F... | 36.165468 | 94 | 0.599761 |
3da0aebbf9deb03fed2d2fe01ffa710023bfaf54 | 1,325 | py | Python | syn/types/a/tests/test_special.py | mbodenhamer/syn | aeaa3ad8a49bac8f50cf89b6f1fe97ad43d1d258 | [
"MIT"
] | 1 | 2021-07-15T08:55:12.000Z | 2021-07-15T08:55:12.000Z | syn/types/a/tests/test_special.py | mbodenhamer/syn | aeaa3ad8a49bac8f50cf89b6f1fe97ad43d1d258 | [
"MIT"
] | 7 | 2021-01-07T23:51:57.000Z | 2021-12-13T19:50:57.000Z | syn/types/a/tests/test_special.py | mbodenhamer/syn | aeaa3ad8a49bac8f50cf89b6f1fe97ad43d1d258 | [
"MIT"
] | 2 | 2016-07-11T08:46:31.000Z | 2017-12-13T13:30:51.000Z | from syn.types.a import Type, NONE, \
hashable, serialize, deserialize, estr, rstr, visit, find_ne, \
DifferentTypes, primitive_form
from syn.types.a import enumerate as enumerate_
from syn.base_utils import is_hashable
#-------------------------------------------------------------------------------
# None
de... | 30.813953 | 80 | 0.607547 |
e7bcba52963b9f040975a9e795a29d3b8d52075e | 3,202 | py | Python | py-scripts/dsa_example.py | pmazzocchi/bbt | c898a8b4db3d49c16e3a8d361c2a58e557528830 | [
"MIT"
] | null | null | null | py-scripts/dsa_example.py | pmazzocchi/bbt | c898a8b4db3d49c16e3a8d361c2a58e557528830 | [
"MIT"
] | null | null | null | py-scripts/dsa_example.py | pmazzocchi/bbt | c898a8b4db3d49c16e3a8d361c2a58e557528830 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (C) 2017-2019 The btclib developers
#
# This file is part of btclib. It is subject to the license terms in the
# LICENSE file found in the top-level directory of this distribution.
#
# No part of btclib including this file, may be copied, modified, propagated,
# or distributed except... | 24.821705 | 77 | 0.633979 |
7479abecb1cd07b86d44f50b9fc5f30cc8eb8ddc | 1,641 | py | Python | src/CSMWebServer/app/room/views.py | mastrayer/CSM | 4ea656584dec4fe60771fbf13dc3d6bca00675fd | [
"MIT"
] | 5 | 2016-06-02T09:50:31.000Z | 2018-06-20T04:52:54.000Z | src/CSMWebServer/app/room/views.py | mastrayer/CSM | 4ea656584dec4fe60771fbf13dc3d6bca00675fd | [
"MIT"
] | null | null | null | src/CSMWebServer/app/room/views.py | mastrayer/CSM | 4ea656584dec4fe60771fbf13dc3d6bca00675fd | [
"MIT"
] | null | null | null | from flask import Blueprint, request, render_template, flash, g, session, redirect, url_for
from app import db
from app.room.forms import CreateRoomForm
from app.room.models import Room
from app.user.models import User
from app.player.models import Player
from app.user.decorators import requires_login
mod = Blueprint... | 30.388889 | 94 | 0.704449 |
86997ce3741e184aa05ccaeb9feedc6f5a5dc784 | 1,258 | py | Python | SmartFoxServer_PRO_1.6.6/Server/lib/Lib/test/test_userstring.py | ChisdealHD/DetlasWorldLinux | 336465a4df1a48c9a273329fc7a09d8099c4e4d5 | [
"MIT"
] | 8 | 2016-11-24T09:38:31.000Z | 2021-04-23T13:04:48.000Z | SmartFoxServer_PRO_1.6.6/Server/lib/Lib/test/test_userstring.py | ChisdealHD/DetlasWorldLinux | 336465a4df1a48c9a273329fc7a09d8099c4e4d5 | [
"MIT"
] | 4 | 2018-02-22T07:42:13.000Z | 2021-12-13T10:53:09.000Z | SmartFoxServer_PRO_1.6.6/Server/lib/Lib/test/test_userstring.py | ChisdealHD/DetlasWorldLinux | 336465a4df1a48c9a273329fc7a09d8099c4e4d5 | [
"MIT"
] | 4 | 2018-12-04T12:21:05.000Z | 2021-02-05T08:00:14.000Z | #!/usr/bin/env python
import sys
from test_support import verbose
import string_tests
# UserString is a wrapper around the native builtin string type.
# UserString instances should behave similar to builtin string objects.
# The test cases were in part derived from 'test_string.py'.
from UserString import UserString
i... | 28.590909 | 76 | 0.59221 |
342342fbdc7aaad615e63446cdde47fa509b097e | 2,191 | py | Python | .history/classes/Season_20171107105231.py | reecebenson/DADSA-Tennis-PartA | d0763f819b300fcd0ce27041f5bc4ef0519c00bf | [
"MIT"
] | null | null | null | .history/classes/Season_20171107105231.py | reecebenson/DADSA-Tennis-PartA | d0763f819b300fcd0ce27041f5bc4ef0519c00bf | [
"MIT"
] | null | null | null | .history/classes/Season_20171107105231.py | reecebenson/DADSA-Tennis-PartA | d0763f819b300fcd0ce27041f5bc4ef0519c00bf | [
"MIT"
] | null | null | null | # DADSA - Assignment 1
# Reece Benson
from classes import Player as Player
from classes import Round as Round
class Season():
_app = None
_j_data = None
_name = None
_players = { }
_rounds = { }
_rounds_raw = { }
_settings = { }
def __init__(self, _app, name, j_data):
# Set ou... | 27.049383 | 94 | 0.572798 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.