hexsha stringlengths 40 40 | size int64 4 1.02M | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 209 | max_stars_repo_name stringlengths 5 121 | max_stars_repo_head_hexsha stringlengths 40 40 | 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 4 209 | max_issues_repo_name stringlengths 5 121 | max_issues_repo_head_hexsha stringlengths 40 40 | 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 4 209 | max_forks_repo_name stringlengths 5 121 | max_forks_repo_head_hexsha stringlengths 40 40 | 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 4 1.02M | avg_line_length float64 1.07 66.1k | max_line_length int64 4 266k | alphanum_fraction float64 0.01 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
d2f4274cd9880a5d238d3fa14f2e327f418ff990 | 4,221 | py | Python | contrib/generate_provider_logos_collage_image.py | dupontz/libcloud | 419c69441ea10e7bbf37319e5e8d02e82e7e6b40 | [
"Apache-2.0"
] | 4 | 2017-11-14T17:24:12.000Z | 2020-10-30T01:46:02.000Z | contrib/generate_provider_logos_collage_image.py | dupontz/libcloud | 419c69441ea10e7bbf37319e5e8d02e82e7e6b40 | [
"Apache-2.0"
] | 11 | 2017-01-29T08:59:21.000Z | 2018-07-02T09:17:47.000Z | contrib/generate_provider_logos_collage_image.py | dupontz/libcloud | 419c69441ea10e7bbf37319e5e8d02e82e7e6b40 | [
"Apache-2.0"
] | 4 | 2016-04-04T08:01:48.000Z | 2018-06-06T08:04:36.000Z | #!/usr/bin/env python
#
# 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 (th... | 33.23622 | 76 | 0.666667 |
24a03be85394d3bab2fd7e5ad30c44c741306433 | 8,674 | py | Python | networkx/algorithms/bipartite/centrality.py | jmmcd/networkx | 207ff7d1e9bfaff013ac77c8d6bb79619892c994 | [
"BSD-3-Clause"
] | 1 | 2020-08-08T21:52:34.000Z | 2020-08-08T21:52:34.000Z | networkx/algorithms/bipartite/centrality.py | jmmcd/networkx | 207ff7d1e9bfaff013ac77c8d6bb79619892c994 | [
"BSD-3-Clause"
] | 2 | 2019-11-13T03:48:53.000Z | 2021-02-15T16:52:09.000Z | networkx/algorithms/bipartite/centrality.py | jmmcd/networkx | 207ff7d1e9bfaff013ac77c8d6bb79619892c994 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (C) 2011 by
# Jordi Torrents <jtorrents@milnou.net>
# Aric Hagberg <hagberg@lanl.gov>
# All rights reserved.
# BSD license.
import networkx as nx
__author__ = """\n""".join(['Jordi Torrents <jtorrents@milnou.net>',
'Aric Hagberg (hagberg@lan... | 31.541818 | 79 | 0.603412 |
8e9e00a0402a219ea5bf9fbce14b13de43e7e768 | 976 | py | Python | Python/complete-binary-tree-inserter.py | se77enn/LeetCode-Solution | d29ef5358cae592b63952c3d293897a176fb75e1 | [
"MIT"
] | 1 | 2020-10-27T03:22:31.000Z | 2020-10-27T03:22:31.000Z | Python/complete-binary-tree-inserter.py | se77enn/LeetCode-Solution | d29ef5358cae592b63952c3d293897a176fb75e1 | [
"MIT"
] | null | null | null | Python/complete-binary-tree-inserter.py | se77enn/LeetCode-Solution | d29ef5358cae592b63952c3d293897a176fb75e1 | [
"MIT"
] | 1 | 2021-03-22T18:58:23.000Z | 2021-03-22T18:58:23.000Z | # Time: ctor: O(n)
# insert: O(1)
# get_root: O(1)
# Space: O(n)
class TreeNode(object):
def __init__(self, x):
self.val = x
self.left = None
self.right = None
class CBTInserter(object):
def __init__(self, root):
"""
:type root: TreeNode
""... | 22.181818 | 57 | 0.460041 |
4b9004d7eaacfa82658e2c6a4e99b5102c8277af | 263 | py | Python | src/fl_simulation/utils/types.py | microsoft/fl-simulation | d177d329c82559c7efe82deae8dea8f9baa49495 | [
"MIT"
] | 5 | 2021-12-14T02:21:53.000Z | 2021-12-26T07:45:13.000Z | src/fl_simulation/utils/types.py | microsoft/fl-simulation | d177d329c82559c7efe82deae8dea8f9baa49495 | [
"MIT"
] | 1 | 2022-01-04T04:51:20.000Z | 2022-01-04T04:51:20.000Z | src/fl_simulation/utils/types.py | microsoft/fl-simulation | d177d329c82559c7efe82deae8dea8f9baa49495 | [
"MIT"
] | null | null | null | """Useful type decalrations."""
from typing import List, NewType
import torch
ModelDiff = NewType("ModelDiff", List[torch.Tensor])
"""The model weights update."""
ControlVarDiff = NewType("ControlVarDiff", List[torch.Tensor])
"""The control variate update.""" | 23.909091 | 62 | 0.737643 |
08e284adb9f26dfe8e7df19e776f7be234b47af5 | 41,837 | py | Python | salt/states/cmd.py | ifraixedes/saltstack-salt | b54becb8b43cc9b7c00b2c0bc637ac534dc62896 | [
"Apache-2.0"
] | null | null | null | salt/states/cmd.py | ifraixedes/saltstack-salt | b54becb8b43cc9b7c00b2c0bc637ac534dc62896 | [
"Apache-2.0"
] | null | null | null | salt/states/cmd.py | ifraixedes/saltstack-salt | b54becb8b43cc9b7c00b2c0bc637ac534dc62896 | [
"Apache-2.0"
] | null | null | null | """
Execution of arbitrary commands
===============================
The cmd state module manages the enforcement of executed commands, this
state can tell a command to run under certain circumstances.
A simple example to execute a command:
.. code-block:: yaml
# Store the current date in a file
'date > /tm... | 31.863671 | 114 | 0.609915 |
e46e0f5e89f9fe4c458a73c5902fba2d58bfc60b | 579 | py | Python | src/tests/test_main.py | jugmac00/workout-bo | b334187c5b1c7821043b3f2dbfb5f5d74477ffc5 | [
"BSD-3-Clause"
] | 1 | 2020-12-23T18:26:52.000Z | 2020-12-23T18:26:52.000Z | src/tests/test_main.py | jugmac00/workout-bo | b334187c5b1c7821043b3f2dbfb5f5d74477ffc5 | [
"BSD-3-Clause"
] | 13 | 2020-05-01T19:56:49.000Z | 2021-05-17T07:21:38.000Z | src/tests/test_main.py | jugmac00/workout-bo | b334187c5b1c7821043b3f2dbfb5f5d74477ffc5 | [
"BSD-3-Clause"
] | 1 | 2020-05-01T19:03:28.000Z | 2020-05-01T19:03:28.000Z | from workout_bot.main import extract_dailydare_url
from workout_bot.main import extract_wod_url
# Please note, that the following tests are just smoke tests in order
# to start testing.
# Yes, they rely on a website which is not under my control.
# Yes, I know, this is not good.
# This won't be permanent.
def test_e... | 30.473684 | 72 | 0.756477 |
da546e465c19ba2f4f61b28817638cd8915dd5b7 | 2,347 | py | Python | src/extensions/booksearch/handlers/shamela_handler.py | SafEight/durkabot | 358c66927e95005c03da3d47080f711666ff95c7 | [
"MIT"
] | 3 | 2018-07-09T21:01:17.000Z | 2021-10-17T18:53:47.000Z | src/extensions/booksearch/handlers/shamela_handler.py | SafEight/durkabot | 358c66927e95005c03da3d47080f711666ff95c7 | [
"MIT"
] | 19 | 2018-06-20T05:53:46.000Z | 2019-04-26T22:36:25.000Z | src/extensions/booksearch/handlers/shamela_handler.py | SafEight/durkabot | 358c66927e95005c03da3d47080f711666ff95c7 | [
"MIT"
] | 2 | 2019-02-24T20:16:43.000Z | 2020-09-28T02:09:14.000Z | from urllib.parse import quote_plus, urljoin
import aiohttp
from bs4 import BeautifulSoup, Tag
from extensions.booksearch.bookdata import BookData
class ShamelaHandler:
domain = 'http://shamela.ws/'
search_url = domain + 'index.php/search/word/{0}'
download_url = 'http://d.shamela.ws/epubs/{0}/{1}.epub'... | 33.056338 | 122 | 0.637409 |
b4bbb621ce131225ac7754e79057b99d2d84808a | 15,974 | py | Python | chromium/build/android/pylib/instrumentation/test_runner.py | wedataintelligence/vivaldi-source | 22a46f2c969f6a0b7ca239a05575d1ea2738768c | [
"BSD-3-Clause"
] | 27 | 2016-04-27T01:02:03.000Z | 2021-12-13T08:53:19.000Z | chromium/build/android/pylib/instrumentation/test_runner.py | wedataintelligence/vivaldi-source | 22a46f2c969f6a0b7ca239a05575d1ea2738768c | [
"BSD-3-Clause"
] | 2 | 2017-03-09T09:00:50.000Z | 2017-09-21T15:48:20.000Z | chromium/build/android/pylib/instrumentation/test_runner.py | wedataintelligence/vivaldi-source | 22a46f2c969f6a0b7ca239a05575d1ea2738768c | [
"BSD-3-Clause"
] | 17 | 2016-04-27T02:06:39.000Z | 2019-12-18T08:07:00.000Z | # Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Class for running instrumentation tests on a single device."""
import collections
import logging
import os
import re
import time
from devil.android ... | 37.585882 | 80 | 0.681295 |
5d735f7c80fe4a6b032a569d07d650d72a489220 | 453 | py | Python | fiepipelib/storage/routines/ui/adjectives.py | leith-bartrich/fiepipe | 2f48054a349059ec5919ff9402a02c03b27b5915 | [
"MIT"
] | null | null | null | fiepipelib/storage/routines/ui/adjectives.py | leith-bartrich/fiepipe | 2f48054a349059ec5919ff9402a02c03b27b5915 | [
"MIT"
] | null | null | null | fiepipelib/storage/routines/ui/adjectives.py | leith-bartrich/fiepipe | 2f48054a349059ec5919ff9402a02c03b27b5915 | [
"MIT"
] | null | null | null | import typing
from fiepipelib.storage.routines.localstorage import CommonAdjectivesDict
def get_common_adjectives_choices() -> typing.Dict[str:str]:
adjectives = CommonAdjectivesDict()
choices = typing.Dict[str:str]
for catName in adjectives.keys():
cat = adjectives[catName]
for adj in c... | 26.647059 | 73 | 0.653422 |
5f877d1e0b95cba8590f418561c367eb9786f75e | 64,576 | py | Python | app/window.py | 0xPrateek/ci_edit | 6abc609a8f1b5f85f0ca1af11cebc77ece80fc99 | [
"Apache-2.0"
] | 5 | 2019-10-09T08:01:32.000Z | 2020-01-01T18:17:21.000Z | app/window.py | 0xPrateek/ci_edit | 6abc609a8f1b5f85f0ca1af11cebc77ece80fc99 | [
"Apache-2.0"
] | 1 | 2019-11-01T02:16:28.000Z | 2019-11-01T02:16:28.000Z | app/window.py | 0xPrateek/ci_edit | 6abc609a8f1b5f85f0ca1af11cebc77ece80fc99 | [
"Apache-2.0"
] | null | null | null | # Copyright 2016 Google 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 in writing, ... | 37.155351 | 93 | 0.580463 |
138e9634ecd5186c93f3d38bc18b6552c5997187 | 2,381 | py | Python | src/oci/data_safe/models/change_data_safe_private_endpoint_compartment_details.py | Manny27nyc/oci-python-sdk | de60b04e07a99826254f7255e992f41772902df7 | [
"Apache-2.0",
"BSD-3-Clause"
] | 249 | 2017-09-11T22:06:05.000Z | 2022-03-04T17:09:29.000Z | src/oci/data_safe/models/change_data_safe_private_endpoint_compartment_details.py | Manny27nyc/oci-python-sdk | de60b04e07a99826254f7255e992f41772902df7 | [
"Apache-2.0",
"BSD-3-Clause"
] | 228 | 2017-09-11T23:07:26.000Z | 2022-03-23T10:58:50.000Z | src/oci/data_safe/models/change_data_safe_private_endpoint_compartment_details.py | Manny27nyc/oci-python-sdk | de60b04e07a99826254f7255e992f41772902df7 | [
"Apache-2.0",
"BSD-3-Clause"
] | 224 | 2017-09-27T07:32:43.000Z | 2022-03-25T16:55:42.000Z | # coding: utf-8
# Copyright (c) 2016, 2021, 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... | 33.535211 | 245 | 0.699286 |
19b4799636fe09fb08236a9b05c19a4cad6f42a4 | 683 | py | Python | src/com/python/gui/gui_Demo.py | Leeo1124/pythonDemo | 72e2209c095301a3f1f61edfe03ea69c3c05be40 | [
"Apache-2.0"
] | null | null | null | src/com/python/gui/gui_Demo.py | Leeo1124/pythonDemo | 72e2209c095301a3f1f61edfe03ea69c3c05be40 | [
"Apache-2.0"
] | null | null | null | src/com/python/gui/gui_Demo.py | Leeo1124/pythonDemo | 72e2209c095301a3f1f61edfe03ea69c3c05be40 | [
"Apache-2.0"
] | null | null | null | '''
Created on 2016年8月10日
@author: Administrator
'''
from tkinter import *
import tkinter.messagebox as messagebox
class Application(Frame):
def __init__(self, master=None):
Frame.__init__(self, master)
self.pack()
self.createWidgets()
def createWidgets(self):
self.nameInput =... | 23.551724 | 73 | 0.653001 |
c471a28daf797ae1dd79299286cdad3e9be0d4f7 | 4,092 | py | Python | networks/mlp_mdn.py | wx-b/ibc | 2c9202e50cfee1abdcd955d3ac1b9d68b5d81e53 | [
"Apache-2.0"
] | null | null | null | networks/mlp_mdn.py | wx-b/ibc | 2c9202e50cfee1abdcd955d3ac1b9d68b5d81e53 | [
"Apache-2.0"
] | null | null | null | networks/mlp_mdn.py | wx-b/ibc | 2c9202e50cfee1abdcd955d3ac1b9d68b5d81e53 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2021 The Reach ML Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | 34.1 | 80 | 0.676442 |
a3060e7327ec042ddd7de204fe267533c303a859 | 3,549 | py | Python | mria_py/core/ua.py | ElcoK/MRIA | ce4fc1665004506c43320f968b1f1c435af5bc59 | [
"MIT"
] | null | null | null | mria_py/core/ua.py | ElcoK/MRIA | ce4fc1665004506c43320f968b1f1c435af5bc59 | [
"MIT"
] | null | null | null | mria_py/core/ua.py | ElcoK/MRIA | ce4fc1665004506c43320f968b1f1c435af5bc59 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
This script will produce an uncertainty analysis around the results. This
should improve the interpretation of the modelling outcomes
@author: Elco Koks
@date: Nov, 2017
"""
import pandas as pd
import itertools
from mria_py.core.create_table import Table
from mria_py.core.base_model impo... | 30.86087 | 146 | 0.629191 |
4f2c109aaf0a1fafa6ef733f6d5261ee2ce558ec | 3,705 | py | Python | src/catkin_lint/util.py | eurogroep/catkin_lint | 987d8e1378b4963e4d36032b9410e13c7bbab8f3 | [
"BSD-3-Clause"
] | null | null | null | src/catkin_lint/util.py | eurogroep/catkin_lint | 987d8e1378b4963e4d36032b9410e13c7bbab8f3 | [
"BSD-3-Clause"
] | null | null | null | src/catkin_lint/util.py | eurogroep/catkin_lint | 987d8e1378b4963e4d36032b9410e13c7bbab8f3 | [
"BSD-3-Clause"
] | null | null | null | # coding=utf-8
#
# catkin_lint
# Copyright (c) 2013-2020 Fraunhofer FKIE
#
# 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 ... | 35.285714 | 126 | 0.676653 |
889d26fdd4bc59a0685fe4bc241a51e9b9845189 | 51,473 | py | Python | 7.30.1.dev0/ietf/doc/views_review.py | kesara/ietf-datatracker | dca3ee2ee98bcb75a10687587cf631750be34c79 | [
"Unlicense"
] | null | null | null | 7.30.1.dev0/ietf/doc/views_review.py | kesara/ietf-datatracker | dca3ee2ee98bcb75a10687587cf631750be34c79 | [
"Unlicense"
] | null | null | null | 7.30.1.dev0/ietf/doc/views_review.py | kesara/ietf-datatracker | dca3ee2ee98bcb75a10687587cf631750be34c79 | [
"Unlicense"
] | null | null | null | # Copyright The IETF Trust 2016-2020, All Rights Reserved
# -*- coding: utf-8 -*-
import io
import itertools
import json
import os
import datetime
import requests
import email.utils
from django.utils.http import is_safe_url
from simple_history.utils import update_change_reason
import debug # pyflakes:ignore
fro... | 47.971109 | 363 | 0.657354 |
6cd229c98dffcfd0409a025d1a0767768b3d190c | 469 | py | Python | repl.py | rcarmo/newsfeed-corpus | b1f649e78b3c115c8f66b298fd72cdc8605cff4c | [
"MIT"
] | 21 | 2016-11-22T12:15:37.000Z | 2021-09-23T18:20:32.000Z | repl.py | rcarmo/newsfeed-corpus | b1f649e78b3c115c8f66b298fd72cdc8605cff4c | [
"MIT"
] | null | null | null | repl.py | rcarmo/newsfeed-corpus | b1f649e78b3c115c8f66b298fd72cdc8605cff4c | [
"MIT"
] | 2 | 2019-12-19T20:37:01.000Z | 2020-01-13T08:28:48.000Z | #!/usr/bin/env python3
""" REPL for database inspection """
from config import (CHECK_INTERVAL, DATABASE_NAME, FETCH_INTERVAL,
MAX_CONCURRENT_REQUESTS, MONGO_SERVER, log)
from datetime import datetime, timedelta
from pymongo import MongoClient
from code import interact
from bpython import embed
d... | 23.45 | 66 | 0.724947 |
ed14ba5f20945812b39f270b9539bedaa300889a | 1,669 | py | Python | cms/plugins/text/cms_plugins.py | christianbertschy/django-cms-2.0 | a98d035b47346b7f6924a807338be3af6566537f | [
"BSD-3-Clause"
] | 1 | 2015-09-24T00:36:34.000Z | 2015-09-24T00:36:34.000Z | cms/plugins/text/cms_plugins.py | christianbertschy/django-cms-2.0 | a98d035b47346b7f6924a807338be3af6566537f | [
"BSD-3-Clause"
] | null | null | null | cms/plugins/text/cms_plugins.py | christianbertschy/django-cms-2.0 | a98d035b47346b7f6924a807338be3af6566537f | [
"BSD-3-Clause"
] | null | null | null | from cms.plugin_pool import plugin_pool
from cms.plugin_base import CMSPluginBase
from django.utils.translation import ugettext_lazy as _
from models import Text
from cms.plugins.text.forms import TextForm
from cms.plugins.text.widgets import WYMEditor
from cms.plugins.text.utils import plugin_tags_to_user_html
from dj... | 35.510638 | 89 | 0.705812 |
1f893d06ce997af05443b3ec4b01c0daff3211dc | 2,814 | py | Python | lib/googlecloudsdk/compute/subcommands/url_maps/remove_path_matcher.py | IsaacHuang/google-cloud-sdk | 52afa5d1a75dff08f4f5380c5cccc015bf796ca5 | [
"Apache-2.0"
] | null | null | null | lib/googlecloudsdk/compute/subcommands/url_maps/remove_path_matcher.py | IsaacHuang/google-cloud-sdk | 52afa5d1a75dff08f4f5380c5cccc015bf796ca5 | [
"Apache-2.0"
] | null | null | null | lib/googlecloudsdk/compute/subcommands/url_maps/remove_path_matcher.py | IsaacHuang/google-cloud-sdk | 52afa5d1a75dff08f4f5380c5cccc015bf796ca5 | [
"Apache-2.0"
] | 2 | 2020-07-25T05:03:06.000Z | 2020-11-04T04:55:57.000Z | # Copyright 2014 Google Inc. All Rights Reserved.
"""Command for removing a path matcher from a URL map."""
import copy
from googlecloudsdk.calliope import exceptions
from googlecloudsdk.compute.lib import base_classes
class RemovePathMatcher(base_classes.ReadWriteCommand):
"""Remove a path matcher from a URL map.... | 29.93617 | 78 | 0.657072 |
2c95e55a51006180c686982b336fa6bb709a5ef5 | 2,875 | py | Python | examples/test_healthcheck.py | zmdismai/tcf | 3903e0a2f444c3aa14647a5147a0df76a49e4195 | [
"Apache-2.0"
] | null | null | null | examples/test_healthcheck.py | zmdismai/tcf | 3903e0a2f444c3aa14647a5147a0df76a49e4195 | [
"Apache-2.0"
] | null | null | null | examples/test_healthcheck.py | zmdismai/tcf | 3903e0a2f444c3aa14647a5147a0df76a49e4195 | [
"Apache-2.0"
] | null | null | null | #! /usr/bin/python2
#
# Copyright (c) 2017 Intel Corporation
#
# SPDX-License-Identifier: Apache-2.0
#
# We don't care for documenting all the interfaces, names should be
# self-descriptive:
#
# - pylint: disable = missing-docstring
import os
import tcfl.tc
import tcfl.tl
@tcfl.tc.tags(**tcfl.tl.zephyr_tags())
# Ask ... | 33.430233 | 76 | 0.642783 |
39dfd9e3bfaf989ab98084737e7ac77c221b2e94 | 577 | py | Python | apps/announcements/migrations/0001_initial.py | Ev1dentSnow/ArtemisAPI_django | ca7ef0ccc97114f2c5439b7b1bbc0e635facf020 | [
"MIT"
] | null | null | null | apps/announcements/migrations/0001_initial.py | Ev1dentSnow/ArtemisAPI_django | ca7ef0ccc97114f2c5439b7b1bbc0e635facf020 | [
"MIT"
] | null | null | null | apps/announcements/migrations/0001_initial.py | Ev1dentSnow/ArtemisAPI_django | ca7ef0ccc97114f2c5439b7b1bbc0e635facf020 | [
"MIT"
] | null | null | null | # Generated by Django 3.2.5 on 2021-07-08 23:39
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Announcement',
fields=[
('id', models.Integ... | 22.192308 | 79 | 0.516464 |
e5edca6d60e9de36c1adb95824acef18b3dcf554 | 2,553 | py | Python | src/sqlfluff/core/rules/std/L045.py | swanderz/sqlfluff | 668f23500ce5d06f4de67333a8957811c2df485f | [
"MIT"
] | null | null | null | src/sqlfluff/core/rules/std/L045.py | swanderz/sqlfluff | 668f23500ce5d06f4de67333a8957811c2df485f | [
"MIT"
] | null | null | null | src/sqlfluff/core/rules/std/L045.py | swanderz/sqlfluff | 668f23500ce5d06f4de67333a8957811c2df485f | [
"MIT"
] | null | null | null | """Implementation of Rule L045."""
from typing import Dict, List
from sqlfluff.core.dialects.base import Dialect
from sqlfluff.core.rules.base import BaseRule, LintResult
from sqlfluff.core.rules.analysis.select_crawler import SelectCrawler
from sqlfluff.core.rules.doc_decorators import document_fix_compatible
@docu... | 31.134146 | 86 | 0.585586 |
e52214da164209c452fbddfdeee7c04b2b70b105 | 875 | py | Python | checker.py | Wh1t3Fox/ar15-sales | b1680c8b4fb06aab5a52c338ac1747ac5ec61ca4 | [
"MIT"
] | null | null | null | checker.py | Wh1t3Fox/ar15-sales | b1680c8b4fb06aab5a52c338ac1747ac5ec61ca4 | [
"MIT"
] | null | null | null | checker.py | Wh1t3Fox/ar15-sales | b1680c8b4fb06aab5a52c338ac1747ac5ec61ca4 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
'''
Pretty simplistic web scraper for AR parts
'''
from bs4 import BeautifulSoup as bs
import requests
import yaml
_BRAND_ALERT = False
# Parse config file
def get_config(filename):
global _BRAND_ALERT
with open(filename) as fr:
config = yaml.safe_load(fr)
if config['br... | 18.617021 | 45 | 0.657143 |
1ba780da4d696dc7898ede198c8ff16b004ee180 | 184,510 | py | Python | tests/unit/constraints/test_tabular.py | HDI-Project/SDV | 04cfd6557d3676fa487e49e1cbd56eecd69a9bc6 | [
"MIT"
] | 39 | 2018-07-07T01:02:42.000Z | 2019-12-17T13:53:47.000Z | tests/unit/constraints/test_tabular.py | HDI-Project/SDV | 04cfd6557d3676fa487e49e1cbd56eecd69a9bc6 | [
"MIT"
] | 75 | 2018-06-29T00:35:02.000Z | 2019-12-23T16:59:55.000Z | tests/unit/constraints/test_tabular.py | HDI-Project/SDV | 04cfd6557d3676fa487e49e1cbd56eecd69a9bc6 | [
"MIT"
] | 31 | 2018-10-29T13:16:38.000Z | 2020-01-02T13:10:42.000Z | """Tests for the sdv.constraints.tabular module."""
import uuid
from datetime import datetime
from unittest.mock import Mock
import numpy as np
import pandas as pd
import pytest
from sdv.constraints.errors import MissingConstraintColumnError
from sdv.constraints.tabular import (
Between, ColumnFormula, CustomCon... | 32.836804 | 100 | 0.551699 |
67ff72011a09cb59f5a9600e05429813dd388b81 | 11,138 | py | Python | src/opserver/alarmgen_cfg.py | UbuntuEvangelist/contrail-controller | 4e8a992230f8f8e91e4f753e19b5442d9e1b446d | [
"Apache-2.0"
] | null | null | null | src/opserver/alarmgen_cfg.py | UbuntuEvangelist/contrail-controller | 4e8a992230f8f8e91e4f753e19b5442d9e1b446d | [
"Apache-2.0"
] | null | null | null | src/opserver/alarmgen_cfg.py | UbuntuEvangelist/contrail-controller | 4e8a992230f8f8e91e4f753e19b5442d9e1b446d | [
"Apache-2.0"
] | 18 | 2017-01-12T09:28:44.000Z | 2019-04-18T20:47:42.000Z | import argparse, os, ConfigParser, sys, re
from pysandesh.sandesh_base import *
from pysandesh.gen_py.sandesh.ttypes import SandeshLevel
class CfgParser(object):
def __init__(self, argv):
self._devices = []
self._args = None
self.__pat = None
self._argv = argv or ' '.join(sys.argv[... | 38.406897 | 84 | 0.580356 |
99cdaeea0abf585ce66f2e7d98a1778de9913ce6 | 2,702 | py | Python | Server/recipe/tool.py | it-intensive-programming2/HCI_project | 1530c181ae2bad62bd216aa851cea60ba6594738 | [
"MIT"
] | 2 | 2021-08-05T02:33:17.000Z | 2021-08-19T17:10:57.000Z | Server/recipe/tool.py | it-intensive-programming2/HCI_project | 1530c181ae2bad62bd216aa851cea60ba6594738 | [
"MIT"
] | 1 | 2021-01-04T01:39:02.000Z | 2021-01-04T01:39:02.000Z | Server/recipe/tool.py | it-intensive-programming2/recipe_helper | 1530c181ae2bad62bd216aa851cea60ba6594738 | [
"MIT"
] | null | null | null | import os
import sys
import urllib.request
import json
from fatsecret import Fatsecret
from tqdm import tqdm
import pandas as pd
import matplotlib.pyplot as plt
from wordcloud import WordCloud
import numpy as np
import base64
from PIL import Image
import cv2
from collections import Counter
# 네이버 파파고 번역 api
def transl... | 26.752475 | 82 | 0.641377 |
eb558aa16320e9940f99909f5e55630c3cace359 | 2,014 | py | Python | tests/providers/google/suite/operators/test_sheets.py | troywinter/airflow | ba66ba0d97941c55d9f00f66329a9d3c7ad673e7 | [
"Apache-2.0"
] | 3 | 2015-08-25T13:56:44.000Z | 2020-03-21T10:26:58.000Z | tests/providers/google/suite/operators/test_sheets.py | troywinter/airflow | ba66ba0d97941c55d9f00f66329a9d3c7ad673e7 | [
"Apache-2.0"
] | 37 | 2020-07-21T07:50:02.000Z | 2022-03-29T22:31:28.000Z | tests/providers/google/suite/operators/test_sheets.py | troywinter/airflow | ba66ba0d97941c55d9f00f66329a9d3c7ad673e7 | [
"Apache-2.0"
] | 4 | 2020-07-17T14:02:28.000Z | 2022-02-23T04:29:58.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 38 | 105 | 0.727408 |
ddb90783f9e38ba7b032eac08f569ba19c0085cb | 720 | py | Python | app/core/tests/test_commands.py | tsiaGeorge/recipe-app-api | eed9387aafb6f3efb169ff93e315a59baec8752f | [
"MIT"
] | null | null | null | app/core/tests/test_commands.py | tsiaGeorge/recipe-app-api | eed9387aafb6f3efb169ff93e315a59baec8752f | [
"MIT"
] | 11 | 2020-02-11T23:38:02.000Z | 2022-02-10T07:14:08.000Z | app/core/tests/test_commands.py | tsiaGeorge/recipe-app-api | eed9387aafb6f3efb169ff93e315a59baec8752f | [
"MIT"
] | null | null | null | from unittest.mock import patch
from django.core.management import call_command
from django.db import OperationalError
from django.test import TestCase
class CommandTests(TestCase):
@patch('django.db.utils.ConnectionHandler.__getitem__', return_value=True)
def test_wait_for_db_ready(self, gi):
gi.re... | 32.727273 | 78 | 0.731944 |
670cbfd0185dcaef0fd19fdc1d58f30afd4cd157 | 1,232 | py | Python | sscutils/tests/test_validation.py | papsebestyen/sscutils | dff8b62ab31c9dfe1494264f9319e287945762bc | [
"MIT"
] | null | null | null | sscutils/tests/test_validation.py | papsebestyen/sscutils | dff8b62ab31c9dfe1494264f9319e287945762bc | [
"MIT"
] | 21 | 2021-09-15T15:31:22.000Z | 2022-03-20T17:10:50.000Z | sscutils/tests/test_validation.py | papsebestyen/sscutils | dff8b62ab31c9dfe1494264f9319e287945762bc | [
"MIT"
] | 2 | 2021-09-08T14:12:00.000Z | 2021-09-29T10:58:08.000Z | import pytest
from sscutils.artifact_context import ArtifactContext
from sscutils.exceptions import NotAnArtifactException
from sscutils.utils import cd_into
from sscutils.validation_functions import is_repo_name, is_step_name
@pytest.mark.parametrize(
"repo_name,is_valid",
[
("abc", True),
(... | 22 | 68 | 0.62013 |
902118645f30e4b792be4fd623738f85b904fdca | 116 | py | Python | library/admin.py | Chenthan/Onlinelibrary | 69c76d48702276ba23fbe229ec68db4ef571fef5 | [
"BSD-3-Clause"
] | null | null | null | library/admin.py | Chenthan/Onlinelibrary | 69c76d48702276ba23fbe229ec68db4ef571fef5 | [
"BSD-3-Clause"
] | null | null | null | library/admin.py | Chenthan/Onlinelibrary | 69c76d48702276ba23fbe229ec68db4ef571fef5 | [
"BSD-3-Clause"
] | null | null | null | from django.contrib import admin
from .models import reader
# Register your models here.
admin.site.register(reader) | 29 | 32 | 0.818966 |
ed00ab1478a55d8ff5477fc1e634512d4fc1fb1d | 7,243 | py | Python | torchmetrics/utilities/data.py | pranjaldatta/metrics | 078671fa0b28d7d0a9c505b077d9acc8ac28a69d | [
"Apache-2.0"
] | 1 | 2021-05-09T16:11:48.000Z | 2021-05-09T16:11:48.000Z | torchmetrics/utilities/data.py | pranjaldatta/metrics | 078671fa0b28d7d0a9c505b077d9acc8ac28a69d | [
"Apache-2.0"
] | null | null | null | torchmetrics/utilities/data.py | pranjaldatta/metrics | 078671fa0b28d7d0a9c505b077d9acc8ac28a69d | [
"Apache-2.0"
] | null | null | null | # Copyright The PyTorch Lightning team.
#
# 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... | 31.354978 | 114 | 0.627226 |
f6db116d38364861f5c10d0885c6e59f65964bea | 7,247 | py | Python | pson.py | antonioluna/proyecto_JSON | b413a2e699116f17cba60d6966001d5876494e19 | [
"Unlicense"
] | null | null | null | pson.py | antonioluna/proyecto_JSON | b413a2e699116f17cba60d6966001d5876494e19 | [
"Unlicense"
] | null | null | null | pson.py | antonioluna/proyecto_JSON | b413a2e699116f17cba60d6966001d5876494e19 | [
"Unlicense"
] | null | null | null | #-*- coding: utf-8 -*-
import json
#Obtiene los codigos de los distritos
def recorrer(dato1, dato2):
datos = {}
for x in educacionr:
datos[x[dato1]] = x[dato2]
return datos
#Obtiene las instituciones por distrito
def instituciones(codigo):
datos = {}
for x in educacionr:
if x[co... | 35.699507 | 78 | 0.412723 |
cdfc8c420400dfac25a6e569fe313402509af689 | 11,149 | py | Python | Raws-Maji/Lapis ReLiGHTs [BD]/lapis_mv02.py | Ichunjo/encode-script | 389a9f497e637eaade6f99acee816636856961d4 | [
"MIT"
] | 36 | 2019-11-08T20:50:07.000Z | 2022-03-23T05:43:55.000Z | Raws-Maji/Lapis ReLiGHTs [BD]/lapis_mv02.py | Ichunjo/encode-script | 389a9f497e637eaade6f99acee816636856961d4 | [
"MIT"
] | 1 | 2019-11-08T21:26:16.000Z | 2019-11-08T21:26:16.000Z | Raws-Maji/Lapis ReLiGHTs [BD]/lapis_mv02.py | Ichunjo/encode-script | 389a9f497e637eaade6f99acee816636856961d4 | [
"MIT"
] | 7 | 2019-11-08T21:10:47.000Z | 2022-03-28T21:57:04.000Z | """Lapis script"""
__author__ = 'Vardë'
import os
import sys
import shlex
import subprocess
from typing import NamedTuple, Optional, Dict, Any
from pathlib import Path
from functools import partial
from adptvgrnMod import adptvgrnMod
import vardefunc as vdf
import muvsfunc as muvf
import mvsfunc as mvf
import G41Fun ... | 37.039867 | 210 | 0.622388 |
a6ad55baa5266055ab5f388c430976a0ff7119d2 | 9 | py | Python | test.py | eaeschl/Web-Python-html-css | 36fe0c5676477e4a963932d35961565f5e016d6b | [
"MIT"
] | null | null | null | test.py | eaeschl/Web-Python-html-css | 36fe0c5676477e4a963932d35961565f5e016d6b | [
"MIT"
] | null | null | null | test.py | eaeschl/Web-Python-html-css | 36fe0c5676477e4a963932d35961565f5e016d6b | [
"MIT"
] | null | null | null | print()
| 4.5 | 8 | 0.555556 |
61129eaeb84785803d8c3d796b2d60d5d4e77c9f | 7,800 | py | Python | GitSvnServer/server.py | slonopotamus/git_svn_server | 80889d9557c99873ceaa58e5260b8edfa30bcffb | [
"BSD-3-Clause"
] | 1 | 2016-01-24T11:59:25.000Z | 2016-01-24T11:59:25.000Z | GitSvnServer/server.py | slonopotamus/git_svn_server | 80889d9557c99873ceaa58e5260b8edfa30bcffb | [
"BSD-3-Clause"
] | null | null | null | GitSvnServer/server.py | slonopotamus/git_svn_server | 80889d9557c99873ceaa58e5260b8edfa30bcffb | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/python
import re
from SocketServer import *
import signal
import sys
import os
import socket
import traceback
from GitSvnServer.config import load_config
import auth
import client
import command
import editor
import report
import generate as gen
from errors import *
addr_family = socket.AF_INET
all_interf... | 26.712329 | 100 | 0.488077 |
dfc5a92b608d2e4a264e67abe17b6ef588d1bb07 | 1,343 | py | Python | pyro_models/arm/radon_intercept.py | jpchen/pyro-models | b9e6ae6271e6cd622fbb4d34d67c450d5a954c9b | [
"Apache-2.0"
] | 30 | 2019-02-22T03:03:18.000Z | 2022-01-22T15:57:37.000Z | pyro_models/arm/radon_intercept.py | jpchen/pyro-models | b9e6ae6271e6cd622fbb4d34d67c450d5a954c9b | [
"Apache-2.0"
] | 7 | 2019-02-26T18:28:57.000Z | 2021-06-11T17:21:06.000Z | pyro_models/arm/radon_intercept.py | jpchen/pyro-models | b9e6ae6271e6cd622fbb4d34d67c450d5a954c9b | [
"Apache-2.0"
] | 8 | 2019-02-25T22:06:14.000Z | 2022-02-18T23:19:49.000Z | # Copyright Contributors to the Pyro project.
# SPDX-License-Identifier: Apache-2.0
# model file: example-models/ARM/Ch.12/radon_intercept.stan
import torch
import pyro
import pyro.distributions as dist
def init_vector(name, dims=None):
return pyro.sample(name, dist.Normal(torch.zeros(dims), 0.2 * torch.ones(dims... | 29.844444 | 96 | 0.638868 |
08b4cc80bf936c0bf8043a431d40f01fdf94e409 | 2,338 | py | Python | aliyun-python-sdk-rds/aliyunsdkrds/request/v20140815/ModifyReadonlyInstanceDelayReplicationTimeRequest.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-rds/aliyunsdkrds/request/v20140815/ModifyReadonlyInstanceDelayReplicationTimeRequest.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-rds/aliyunsdkrds/request/v20140815/ModifyReadonlyInstanceDelayReplicationTimeRequest.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... | 37.709677 | 101 | 0.785287 |
4fb2dd2106244e3a5d6eb55bfba8341189f75677 | 4,457 | py | Python | data/utils.py | Khoale1096/stupidNMT | 894536c16dc7ff958aa5571828a89ecabfcb72d7 | [
"BSD-3-Clause"
] | 31 | 2020-05-05T21:56:45.000Z | 2022-02-24T19:08:19.000Z | data/utils.py | Khoale1096/stupidNMT | 894536c16dc7ff958aa5571828a89ecabfcb72d7 | [
"BSD-3-Clause"
] | 2 | 2019-10-02T15:23:55.000Z | 2019-10-16T02:38:25.000Z | data/utils.py | Khoale1096/stupidNMT | 894536c16dc7ff958aa5571828a89ecabfcb72d7 | [
"BSD-3-Clause"
] | 5 | 2020-05-06T06:04:40.000Z | 2020-12-29T14:09:31.000Z | '''
Utilities useful for datasets
'''
import pdb
import os
from functools import partial
from urllib.request import urlretrieve
import requests
from tqdm import tqdm
from torch.utils.data.dataloader import DataLoader
from torch.utils.data.sampler import BatchSampler, RandomSampler, SequentialSampler
from data.sample... | 33.261194 | 99 | 0.661656 |
e1efef18ae62e8d751740269df59186ecf836dd8 | 13,548 | py | Python | ncachefactory/cachemanager.py | luckylyk/ncachefactory | 3b26866e552bf6462024ce3febef31f4eec2ab69 | [
"BSD-3-Clause-Clear"
] | 1 | 2019-09-25T17:16:06.000Z | 2019-09-25T17:16:06.000Z | ncachefactory/cachemanager.py | luckylyk/ncachemanager | 3b26866e552bf6462024ce3febef31f4eec2ab69 | [
"BSD-3-Clause-Clear"
] | 1 | 2020-03-15T10:34:34.000Z | 2020-05-22T19:20:26.000Z | ncachefactory/cachemanager.py | luckylyk/ncachefactory | 3b26866e552bf6462024ce3febef31f4eec2ab69 | [
"BSD-3-Clause-Clear"
] | null | null | null | """
This module is on top of ncache and versioning
It combine both to work in a defined workspace
This is the main api used by the ui and can be useb from external script as
well.
"""
import os
import shutil
from datetime import datetime
from functools import partial
import subprocess
from maya import cmds
import may... | 39.043228 | 83 | 0.714275 |
1597ca52d7ead48a76678cbcd9f3401996623874 | 4,694 | py | Python | heartbeat/heartbeat.py | WATORACE/dds-tunnel | 85726c9742eed41befb7cde96bd3d58389b7a82f | [
"MIT"
] | null | null | null | heartbeat/heartbeat.py | WATORACE/dds-tunnel | 85726c9742eed41befb7cde96bd3d58389b7a82f | [
"MIT"
] | null | null | null | heartbeat/heartbeat.py | WATORACE/dds-tunnel | 85726c9742eed41befb7cde96bd3d58389b7a82f | [
"MIT"
] | null | null | null | import argparse
import asyncio
import os
import rticonnextdds_connector as rti
import sys
import threading
from enum import IntEnum
from time import sleep, time
try:
SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__))
except NameError:
SCRIPT_DIR = os.getcwd()
DOMAIN_ID_ENV_VAR = 'HEARTBEAT_DOMAIN_ID'
# ... | 34.514706 | 147 | 0.629527 |
1b38735078606e8ab55563bd6ab367910eed1669 | 3,818 | py | Python | Code/splines_projection.py | AndreasMadsen/grace | bf472d30a2fac76145d3f68e819c92da4a1970ba | [
"MIT"
] | 1 | 2016-05-17T22:52:19.000Z | 2016-05-17T22:52:19.000Z | Code/splines_projection.py | AndreasMadsen/grace | bf472d30a2fac76145d3f68e819c92da4a1970ba | [
"MIT"
] | null | null | null | Code/splines_projection.py | AndreasMadsen/grace | bf472d30a2fac76145d3f68e819c92da4a1970ba | [
"MIT"
] | null | null | null |
import grace
import grace.times
import grace.ols
import math
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
worldImage = mpimg.imread('equirectangular.png')
days = grace.ols.time_vector()
days_all = np.linspace(np.min(days), np.max(days), np.max(days) - np.min(days))
X_all = grac... | 28.924242 | 91 | 0.701676 |
81f7252a16c7b660b0788cc1e584d8be47ad6c81 | 1,212 | py | Python | clients/kratos/python/test/test_admin_create_identity_body.py | kolotaev/sdk | 0dda1becd70be8d7b9d678321ebe780c1ba00485 | [
"Apache-2.0"
] | null | null | null | clients/kratos/python/test/test_admin_create_identity_body.py | kolotaev/sdk | 0dda1becd70be8d7b9d678321ebe780c1ba00485 | [
"Apache-2.0"
] | null | null | null | clients/kratos/python/test/test_admin_create_identity_body.py | kolotaev/sdk | 0dda1becd70be8d7b9d678321ebe780c1ba00485 | [
"Apache-2.0"
] | null | null | null | """
Ory Kratos API
Documentation for all public and administrative Ory Kratos APIs. Public and administrative APIs are exposed on different ports. Public APIs can face the public internet without any protection while administrative APIs should never be exposed without prior authorization. To protect the admini... | 32.756757 | 446 | 0.749175 |
e3229314b62acbba0f69bb94935aa371efd3144c | 3,145 | py | Python | basicts/options/GMAN/GMAN_PEMS-BAY.py | zezhishao/GuanCang_BasicTS | bbf82b9d08e82db78d4e9e9b11f43a676b54ad7c | [
"Apache-2.0"
] | null | null | null | basicts/options/GMAN/GMAN_PEMS-BAY.py | zezhishao/GuanCang_BasicTS | bbf82b9d08e82db78d4e9e9b11f43a676b54ad7c | [
"Apache-2.0"
] | null | null | null | basicts/options/GMAN/GMAN_PEMS-BAY.py | zezhishao/GuanCang_BasicTS | bbf82b9d08e82db78d4e9e9b11f43a676b54ad7c | [
"Apache-2.0"
] | null | null | null | import os
from easydict import EasyDict
# architecture
from basicts.archs.GMAN_arch import GMAN
# runner
from basicts.runners.GMAN_runner import GMANRunner
from basicts.data.base_dataset import BaseDataset
from basicts.metrics.mae import masked_mae
from basicts.metrics.mape import masked_mape
from basicts.metrics.rmse... | 27.831858 | 89 | 0.635612 |
adfa0c6184b1ecdfee4857e80706325c950e40f4 | 1,626 | py | Python | gridpath/objective/system/reliability/local_capacity/aggregate_local_capacity_violation_penalties.py | souissim/gridpath | 4eeca2be24b485edc56026e38cfda83f4a6b27ea | [
"Apache-2.0"
] | null | null | null | gridpath/objective/system/reliability/local_capacity/aggregate_local_capacity_violation_penalties.py | souissim/gridpath | 4eeca2be24b485edc56026e38cfda83f4a6b27ea | [
"Apache-2.0"
] | null | null | null | gridpath/objective/system/reliability/local_capacity/aggregate_local_capacity_violation_penalties.py | souissim/gridpath | 4eeca2be24b485edc56026e38cfda83f4a6b27ea | [
"Apache-2.0"
] | 1 | 2021-12-21T20:44:21.000Z | 2021-12-21T20:44:21.000Z | # Copyright 2016-2020 Blue Marble Analytics LLC.
#
# 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 ag... | 30.111111 | 74 | 0.728167 |
801c1b102ed3f845dd8b1bf138933334e33a686d | 28,312 | py | Python | sgml/SGMLLexer.py | leon332157/Grail-browser | 5b357c9414a2e0139779724439afbc917ef2fb60 | [
"CNRI-Jython"
] | 8 | 2015-02-18T18:50:50.000Z | 2022-03-15T22:21:03.000Z | sgml/SGMLLexer.py | leon332157/Grail-browser | 5b357c9414a2e0139779724439afbc917ef2fb60 | [
"CNRI-Jython"
] | null | null | null | sgml/SGMLLexer.py | leon332157/Grail-browser | 5b357c9414a2e0139779724439afbc917ef2fb60 | [
"CNRI-Jython"
] | 3 | 2016-04-04T23:54:07.000Z | 2020-10-29T04:25:42.000Z | """A lexer for SGML, using derived classes as parser and DTD.
This module provides a transparent interface allowing the use of
alternate lexical analyzers without modifying higher levels of SGML
or HTML support.
"""
__version__ = "$Revision: 1.45 $"
# These constants are not used in this module, but are provided to
... | 36.25096 | 76 | 0.492583 |
dae0187f8846482fe0cb5c8dabc2fa1adecd8e8e | 753 | py | Python | tests/io/stringio1.py | LabAixBidouille/micropython | 11aa6ba456287d6c80598a7ebbebd2887ce8f5a2 | [
"MIT"
] | null | null | null | tests/io/stringio1.py | LabAixBidouille/micropython | 11aa6ba456287d6c80598a7ebbebd2887ce8f5a2 | [
"MIT"
] | null | null | null | tests/io/stringio1.py | LabAixBidouille/micropython | 11aa6ba456287d6c80598a7ebbebd2887ce8f5a2 | [
"MIT"
] | null | null | null | import _io as io
a = io.StringIO()
print(a.getvalue())
print(a.read())
a = io.StringIO("foobar")
print(a.getvalue())
print(a.read())
print(a.read())
a = io.StringIO()
a.write("foo")
print(a.getvalue())
a = io.StringIO("foo")
a.write("12")
print(a.getvalue())
a = io.StringIO("foo")
a.write("123")
print(a.getvalue()... | 17.928571 | 71 | 0.642762 |
45cded092f5ec52801ec3684e3568c8b5ad86154 | 2,579 | py | Python | nova/api/openstack/compute/schemas/services.py | lixiaoy1/nova | 357b8b38e88300948bb2e07d1bbaabd1e9d7b60e | [
"Apache-2.0"
] | 2 | 2021-10-11T04:56:25.000Z | 2022-02-16T08:49:29.000Z | nova/api/openstack/compute/schemas/services.py | woraser/nova | fc3890667e4971e3f0f35ac921c2a6c25f72adec | [
"Apache-2.0"
] | 132 | 2017-03-27T11:31:52.000Z | 2022-03-30T08:45:02.000Z | nova/api/openstack/compute/schemas/services.py | woraser/nova | fc3890667e4971e3f0f35ac921c2a6c25f72adec | [
"Apache-2.0"
] | 8 | 2017-03-27T07:50:38.000Z | 2020-02-14T16:55:56.000Z | # Copyright 2014 NEC Corporation. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required ... | 32.64557 | 79 | 0.629701 |
590cbd0d8abf43993a20424a5c92101d12ecc728 | 1,051 | py | Python | blogposts/models.py | cesarrodas/cesars-blog | 497f4c20bab24db0c0052004e6199d669dac1fe0 | [
"MIT"
] | null | null | null | blogposts/models.py | cesarrodas/cesars-blog | 497f4c20bab24db0c0052004e6199d669dac1fe0 | [
"MIT"
] | null | null | null | blogposts/models.py | cesarrodas/cesars-blog | 497f4c20bab24db0c0052004e6199d669dac1fe0 | [
"MIT"
] | null | null | null | from django.db import models
from django.utils import timezone
# Create your models here.
class BlogPost(models.Model):
title = models.CharField(max_length=250)
description = models.CharField(max_length=300)
pub_date = models.DateTimeField()
image = models.CharField(max_length=300)
body = models.Te... | 27.657895 | 59 | 0.681256 |
343bdcdf7c2c46293277d788bcbd0c22d70bc4be | 23,973 | py | Python | lib/spc.py | rinocloud/rinobot-plugin-parse-spc | 6bb675a646455e8b9c61bb380705875894fc52e4 | [
"MIT"
] | null | null | null | lib/spc.py | rinocloud/rinobot-plugin-parse-spc | 6bb675a646455e8b9c61bb380705875894fc52e4 | [
"MIT"
] | null | null | null | lib/spc.py | rinocloud/rinobot-plugin-parse-spc | 6bb675a646455e8b9c61bb380705875894fc52e4 | [
"MIT"
] | null | null | null | """
spc class: main class that starts loading data from Thermo Grams *.SPC
file
author: Rohan Isaac
"""
from __future__ import division, absolute_import, unicode_literals, print_function
import struct
import numpy as np
from .sub import subFile, subFileOld
from .global_fun import read_subheader, flag_bits
class Fi... | 34.99708 | 106 | 0.435073 |
03269605c9b199d9a9f397921e3af1f6096d4a92 | 1,545 | py | Python | release/stubs.min/System/Windows/Forms/__init___parts/UICuesEventArgs.py | YKato521/ironpython-stubs | b1f7c580de48528490b3ee5791b04898be95a9ae | [
"MIT"
] | null | null | null | release/stubs.min/System/Windows/Forms/__init___parts/UICuesEventArgs.py | YKato521/ironpython-stubs | b1f7c580de48528490b3ee5791b04898be95a9ae | [
"MIT"
] | null | null | null | release/stubs.min/System/Windows/Forms/__init___parts/UICuesEventArgs.py | YKato521/ironpython-stubs | b1f7c580de48528490b3ee5791b04898be95a9ae | [
"MIT"
] | null | null | null | class UICuesEventArgs(EventArgs):
"""
Provides data for the System.Windows.Forms.Control.ChangeUICues event.
UICuesEventArgs(uicues: UICues)
"""
@staticmethod
def __new__(self, uicues):
""" __new__(cls: type,uicues: UICues) """
pass
Changed = property(lambda self: ... | 20.6 | 89 | 0.642071 |
192dcbd0dbbb52cdf7068fd0800303842ac87d51 | 1,721 | py | Python | examples/pylab_examples/anscombe.py | jbbrokaw/matplotlib | 86ec1b6fc5628bfb2d09797c58d7eed0ca8c2427 | [
"MIT",
"BSD-3-Clause"
] | null | null | null | examples/pylab_examples/anscombe.py | jbbrokaw/matplotlib | 86ec1b6fc5628bfb2d09797c58d7eed0ca8c2427 | [
"MIT",
"BSD-3-Clause"
] | null | null | null | examples/pylab_examples/anscombe.py | jbbrokaw/matplotlib | 86ec1b6fc5628bfb2d09797c58d7eed0ca8c2427 | [
"MIT",
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
from __future__ import print_function
"""
Edward Tufte uses this example from Anscombe to show 4 datasets of x
and y that have the same mean, standard deviation, and regression
line, but which are qualitatively different.
matplotlib fun for a rainy day
"""
from pylab import *
x = array([10, 8,... | 28.683333 | 85 | 0.578733 |
a1a4cdc0b6a81da470b6fc42321181ce1b72778b | 4,272 | py | Python | src/inference.py | by2101/OpenLAS | 0acb30dae98ab89009a919ce86e064c943c51643 | [
"Apache-2.0"
] | 6 | 2019-07-11T12:42:42.000Z | 2020-12-25T07:24:38.000Z | src/inference.py | by2101/OpenLAS | 0acb30dae98ab89009a919ce86e064c943c51643 | [
"Apache-2.0"
] | null | null | null | src/inference.py | by2101/OpenLAS | 0acb30dae98ab89009a919ce86e064c943c51643 | [
"Apache-2.0"
] | 1 | 2020-06-27T15:55:02.000Z | 2020-06-27T15:55:02.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @File : train
# @Author: Ye Bai
# @Date : 2019/4/2
import sys
import os
import argparse
import logging
import yaml
import torch
from data import SpeechDataset, FrameBasedSampler, Collate, load_vocab
from utils import Timer, str2bool
from encoder import BiRNN_Torch, BiRN... | 32.610687 | 102 | 0.64162 |
134bd36b58d77a09cd9d844bfd485e9850dc7140 | 7,998 | py | Python | matilda/data_pipeline/data_scapers/financial_statements_scraper/financial_statements_scraper.py | AlainDaccache/Quantropy | 6cfa06ed2b764471382ebf94d40af867f10433bb | [
"MIT"
] | 45 | 2021-01-28T04:12:21.000Z | 2022-02-24T13:15:50.000Z | matilda/data_pipeline/data_scapers/financial_statements_scraper/financial_statements_scraper.py | AlainDaccache/Quantropy | 6cfa06ed2b764471382ebf94d40af867f10433bb | [
"MIT"
] | 32 | 2021-03-02T18:45:16.000Z | 2022-03-12T00:53:10.000Z | matilda/data_pipeline/data_scapers/financial_statements_scraper/financial_statements_scraper.py | AlainDaccache/Quantropy | 6cfa06ed2b764471382ebf94d40af867f10433bb | [
"MIT"
] | 10 | 2020-12-25T15:02:40.000Z | 2021-12-30T11:40:15.000Z | import collections
import os
import re
import traceback
from datetime import datetime
import pandas as pd
from pprint import pprint
from matilda import config
import io
import json
from zope.interface import Interface
from matilda.data_pipeline.data_preparation_helpers import save_pretty_excel, read_dates_from_csv
cl... | 49.37037 | 231 | 0.595274 |
e05697fc7062a204a1ec05348dad244e1eb321ed | 13,179 | py | Python | lttnganalyses/linuxautomaton/io.py | mjeanson/debian-lttnganalyses | d098edb86bd2b6c33f63aa388c305367302f37d7 | [
"MIT"
] | null | null | null | lttnganalyses/linuxautomaton/io.py | mjeanson/debian-lttnganalyses | d098edb86bd2b6c33f63aa388c305367302f37d7 | [
"MIT"
] | null | null | null | lttnganalyses/linuxautomaton/io.py | mjeanson/debian-lttnganalyses | d098edb86bd2b6c33f63aa388c305367302f37d7 | [
"MIT"
] | null | null | null | # The MIT License (MIT)
#
# Copyright (C) 2015 - Julien Desfossez <jdesfossez@efficios.com>
# 2015 - Antoine Busque <abusque@efficios.com>
#
# 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 t... | 37.979827 | 79 | 0.573716 |
0cc17f72abcfa8707ab2a24d38c907371905c221 | 21,497 | py | Python | geomstats/geometry/discrete_curves.py | tfunatomi/geomstats | a5651680f98dea95c1f82a48af1a6dccf3e26bd1 | [
"MIT"
] | 2 | 2020-01-23T04:01:02.000Z | 2020-08-18T19:20:27.000Z | geomstats/geometry/discrete_curves.py | tfunatomi/geomstats | a5651680f98dea95c1f82a48af1a6dccf3e26bd1 | [
"MIT"
] | null | null | null | geomstats/geometry/discrete_curves.py | tfunatomi/geomstats | a5651680f98dea95c1f82a48af1a6dccf3e26bd1 | [
"MIT"
] | null | null | null | """Parameterized curves on any given manifold."""
import math
import geomstats.backend as gs
from geomstats.geometry.euclidean import Euclidean
from geomstats.geometry.euclidean import EuclideanMetric
from geomstats.geometry.landmarks import L2Metric
from geomstats.geometry.manifold import Manifold
from geomstats.ge... | 40.483992 | 79 | 0.600223 |
ab8574459e236c6b48f5095cb8c81840118839f4 | 8,851 | py | Python | dosagelib/plugins/f.py | acaranta/dosage | 6e14e8709b3b213fdc07a2106464860e1cb99481 | [
"MIT"
] | null | null | null | dosagelib/plugins/f.py | acaranta/dosage | 6e14e8709b3b213fdc07a2106464860e1cb99481 | [
"MIT"
] | null | null | null | dosagelib/plugins/f.py | acaranta/dosage | 6e14e8709b3b213fdc07a2106464860e1cb99481 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (C) 2004-2008 Tristan Seligmann and Jonathan Jacobs
# Copyright (C) 2012-2014 Bastian Kleineidam
# Copyright (C) 2015-2020 Tobias Gruetzmacher
from __future__ import absolute_import, division, print_function
from re import compile, escape
from ..util import tagre
from ..scraper imp... | 34.439689 | 98 | 0.632358 |
fd38dbc87d8d3af01fbe1c4b069db63ac7fa2606 | 1,268 | py | Python | examples/ifft/phenpv3_speed_test.py | LBJ-Wade/phenom | 8f0fdc14099dac09cb2eef36d825e577340a8421 | [
"MIT"
] | null | null | null | examples/ifft/phenpv3_speed_test.py | LBJ-Wade/phenom | 8f0fdc14099dac09cb2eef36d825e577340a8421 | [
"MIT"
] | null | null | null | examples/ifft/phenpv3_speed_test.py | LBJ-Wade/phenom | 8f0fdc14099dac09cb2eef36d825e577340a8421 | [
"MIT"
] | null | null | null | import phenom
import numpy as np
from phenom.utils.utils import Constants, HztoMf
import lal
import lalsimulation as lalsim
#
# m1 = 90./2.
# m2 = 30./2.
# chi1x = 0.9
# chi1y = 0.
# chi1z = 0.
# chi2x = 0.
# chi2y = 0.
# chi2z = 0.
# delta_f = 1./32.
# f_min = 7.
# fRef = f_min
# inclination = np.pi/3. * 0.
m1=8... | 20.451613 | 55 | 0.755521 |
ab1daa485cbd0d04fcd11916195b55d83abd367f | 682 | py | Python | templates/sphinx/conf.py | wapcaplet/readthedocs.org | a0eadad2d1c4c61c0b72a2cd801e2aca32291e49 | [
"MIT"
] | 1 | 2015-11-08T11:31:42.000Z | 2015-11-08T11:31:42.000Z | templates/sphinx/conf.py | wapcaplet/readthedocs.org | a0eadad2d1c4c61c0b72a2cd801e2aca32291e49 | [
"MIT"
] | null | null | null | templates/sphinx/conf.py | wapcaplet/readthedocs.org | a0eadad2d1c4c61c0b72a2cd801e2aca32291e49 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import sys, os
extensions = []
templates_path = ['{{ template_dir }}', 'templates', '_templates', '.templates']
source_suffix = '{{ project.suffix }}'
master_doc = 'index'
project = u'{{ project.name }}'
copyright = u'{{ project.copyright }}'
version = '{{ project.version }}'
release = '{{ proj... | 31 | 80 | 0.645161 |
5d8ea62dd314044be0c745e4673d283b2257d3fd | 561 | py | Python | py_file_carving/libary/plugins/__init__.py | wahlflo/pyFileCarving | 7bbbbedccb551273fd4b22614c86f51bc876bd78 | [
"MIT"
] | null | null | null | py_file_carving/libary/plugins/__init__.py | wahlflo/pyFileCarving | 7bbbbedccb551273fd4b22614c86f51bc876bd78 | [
"MIT"
] | null | null | null | py_file_carving/libary/plugins/__init__.py | wahlflo/pyFileCarving | 7bbbbedccb551273fd4b22614c86f51bc876bd78 | [
"MIT"
] | null | null | null | # Private Keys
# binaries
from .binaries import PeFile
from .certificates import Certificate
# Certificates and Certificate Requests
from .certificates import CertificateRequest
from .certificates import TrustedCertificate
# PDF
from .pdf import PDF
# Pictures
from .pictures import JPG
from .pictures import PNG
from .p... | 29.526316 | 45 | 0.850267 |
a50aad2d56d1852110a3cf74eec61edabefa5e4f | 5,313 | py | Python | huaweicloud-sdk-gaussdbfornosql/huaweicloudsdkgaussdbfornosql/v3/model/slowlog_result.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 64 | 2020-06-12T07:05:07.000Z | 2022-03-30T03:32:50.000Z | huaweicloud-sdk-gaussdbfornosql/huaweicloudsdkgaussdbfornosql/v3/model/slowlog_result.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 11 | 2020-07-06T07:56:54.000Z | 2022-01-11T11:14:40.000Z | huaweicloud-sdk-gaussdbfornosql/huaweicloudsdkgaussdbfornosql/v3/model/slowlog_result.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 24 | 2020-06-08T11:42:13.000Z | 2022-03-04T06:44:08.000Z | # coding: utf-8
import re
import six
from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization
class SlowlogResult:
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is a... | 24.37156 | 96 | 0.548842 |
2a3df4d51c027c2f604f481244a51acf122082b3 | 8,311 | py | Python | app.py | bashkirtsevich/macaque | 9c14dc0f7eb1fde7139ec9bc894282c396c481f7 | [
"MIT"
] | null | null | null | app.py | bashkirtsevich/macaque | 9c14dc0f7eb1fde7139ec9bc894282c396c481f7 | [
"MIT"
] | null | null | null | app.py | bashkirtsevich/macaque | 9c14dc0f7eb1fde7139ec9bc894282c396c481f7 | [
"MIT"
] | null | null | null | import os
from aiohttp import web
from sqlalchemy import create_engine
from sqlalchemy_aio import ASYNCIO_STRATEGY
import api
from arg_schemas import reply_entity_validator, reply_comment_validator, edit_comment_validator, \
remove_comment_validator, read_entity_comments_validator, validate_args, ValidatorExcepti... | 31.127341 | 108 | 0.654554 |
2ae879620ba8bc2a069f3a3015ebb65f477d8a74 | 1,843 | py | Python | tests/test_compute.py | Edubya77/baidu_thing | b0612e926b63c698eea9f2cd924f9f8f054de80f | [
"Unlicense"
] | null | null | null | tests/test_compute.py | Edubya77/baidu_thing | b0612e926b63c698eea9f2cd924f9f8f054de80f | [
"Unlicense"
] | null | null | null | tests/test_compute.py | Edubya77/baidu_thing | b0612e926b63c698eea9f2cd924f9f8f054de80f | [
"Unlicense"
] | null | null | null | # -*- coding: utf-8 -*-
import sys
import unittest
from pathlib import Path
root = str(Path(__file__).resolve().parents[1])
sys.path.append(root)
from baidu.compute import *
class Parse_URLs(unittest.TestCase):
def setUp(self):
self.uri = 'http://www.example.com/en-us/'
def test_can_parse_domain_nam... | 29.725806 | 95 | 0.65274 |
57af2cbf577b550ace311b7a55be5954af0c9390 | 8,472 | py | Python | neo/io/__init__.py | Moritz-Alexander-Kern/python-neo | 2e00c994e46a1396fb4bdd393535604e6fc5568f | [
"BSD-3-Clause"
] | null | null | null | neo/io/__init__.py | Moritz-Alexander-Kern/python-neo | 2e00c994e46a1396fb4bdd393535604e6fc5568f | [
"BSD-3-Clause"
] | null | null | null | neo/io/__init__.py | Moritz-Alexander-Kern/python-neo | 2e00c994e46a1396fb4bdd393535604e6fc5568f | [
"BSD-3-Clause"
] | null | null | null | """
:mod:`neo.io` provides classes for reading and/or writing
electrophysiological data files.
Note that if the package dependency is not satisfied for one io, it does not
raise an error but a warning.
:attr:`neo.io.iolist` provides a list of successfully imported io classes.
Functions:
.. autofunction:: neo.io.get... | 21.723077 | 93 | 0.717186 |
5075d20b2c2eb11ce73e519e601ada505e379e96 | 650 | py | Python | problems/A/SuffixThree.py | deveshbajpai19/CodeForces | 707b374f03012ec68054841f791d48b33ae4ef1b | [
"MIT"
] | 55 | 2016-06-19T05:45:15.000Z | 2022-03-31T15:18:53.000Z | problems/A/SuffixThree.py | farhadcu/CodeForces-2 | 707b374f03012ec68054841f791d48b33ae4ef1b | [
"MIT"
] | null | null | null | problems/A/SuffixThree.py | farhadcu/CodeForces-2 | 707b374f03012ec68054841f791d48b33ae4ef1b | [
"MIT"
] | 25 | 2016-07-29T13:03:15.000Z | 2021-09-17T01:45:45.000Z | __author__ = 'Devesh Bajpai'
'''
https://codeforces.com/problemset/problem/1281/A
Solution: Capture the suffixes of the given string to match with the given possible patterns. Return the
result language accordingly.
~ Tidbit ~
Use s[-x:] to obtain the last x characters of the string s.
'''
def solve(s):
if... | 19.69697 | 105 | 0.593846 |
9d960a5f5996288d90ff77d6253683bfc2ca57b8 | 1,680 | py | Python | .tools/download_emoji_variation_sequences.py | PredaaA/JackCogs | 6677496ed030a219afe32843e95154b01406226a | [
"Apache-2.0"
] | null | null | null | .tools/download_emoji_variation_sequences.py | PredaaA/JackCogs | 6677496ed030a219afe32843e95154b01406226a | [
"Apache-2.0"
] | null | null | null | .tools/download_emoji_variation_sequences.py | PredaaA/JackCogs | 6677496ed030a219afe32843e95154b01406226a | [
"Apache-2.0"
] | null | null | null | # Copyright 2018-2020 Jakub Kuczys (https://github.com/jack1142)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | 31.111111 | 87 | 0.704167 |
d82fd9d74d69a996e5a6eb6594e9f5456f2b6b40 | 5,215 | py | Python | test/functional/test_framework/wallet_util.py | XbitCC/xbitcoin | 2c71b1adc311680e8f3aa977b42029b1a26164f1 | [
"MIT"
] | 2 | 2021-10-16T06:16:02.000Z | 2022-03-26T21:48:38.000Z | test/functional/test_framework/wallet_util.py | XbitCC/xbitcoin | 2c71b1adc311680e8f3aa977b42029b1a26164f1 | [
"MIT"
] | null | null | null | test/functional/test_framework/wallet_util.py | XbitCC/xbitcoin | 2c71b1adc311680e8f3aa977b42029b1a26164f1 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2018-2020 The XBit Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Useful util functions for testing the wallet"""
from collections import namedtuple
from test_framework.ad... | 39.507576 | 118 | 0.602685 |
d01d4b1328c684fe56afd3bfc2db9d49884b2488 | 2,356 | py | Python | airflow/providers/cncf/kubernetes/example_dags/example_spark_kubernetes.py | ChaseKnowlden/airflow | 6b71eac1997a7c0db3b8e3aed6b4e65d01871440 | [
"Apache-2.0"
] | 15,947 | 2019-01-05T13:51:02.000Z | 2022-03-31T23:33:16.000Z | airflow/providers/cncf/kubernetes/example_dags/example_spark_kubernetes.py | ChaseKnowlden/airflow | 6b71eac1997a7c0db3b8e3aed6b4e65d01871440 | [
"Apache-2.0"
] | 14,603 | 2019-01-05T09:43:19.000Z | 2022-03-31T23:11:59.000Z | airflow/providers/cncf/kubernetes/example_dags/example_spark_kubernetes.py | ChaseKnowlden/airflow | 6b71eac1997a7c0db3b8e3aed6b4e65d01871440 | [
"Apache-2.0"
] | 8,429 | 2019-01-05T19:45:47.000Z | 2022-03-31T22:13:01.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... | 35.164179 | 106 | 0.771222 |
6b1084d73e1529677b6dd775e7f5c41b3b63a3ab | 48,704 | py | Python | src/bruce/scripts/check_bruce_counters.py | czchen/debian-bruce | 0db47b345926fefbf958a704cac476b46cb44826 | [
"Apache-2.0"
] | 2 | 2015-05-21T01:49:10.000Z | 2015-06-09T23:28:30.000Z | src/bruce/scripts/check_bruce_counters.py | czchen/debian-bruce | 0db47b345926fefbf958a704cac476b46cb44826 | [
"Apache-2.0"
] | null | null | null | src/bruce/scripts/check_bruce_counters.py | czchen/debian-bruce | 0db47b345926fefbf958a704cac476b46cb44826 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
###############################################################################
# -----------------------------------------------------------------------------
# Copyright 2013-2014 if(we)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in co... | 43.485714 | 79 | 0.554841 |
c4ddb27a8c37fd130e256b1924bf871fb31577da | 81,438 | py | Python | monai/transforms/intensity/array.py | ETS-Research-Repositories/MONAI | ec479d5b054063de61ef7af0caed021b36325fea | [
"Apache-2.0"
] | null | null | null | monai/transforms/intensity/array.py | ETS-Research-Repositories/MONAI | ec479d5b054063de61ef7af0caed021b36325fea | [
"Apache-2.0"
] | null | null | null | monai/transforms/intensity/array.py | ETS-Research-Repositories/MONAI | ec479d5b054063de61ef7af0caed021b36325fea | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 - 2021 MONAI Consortium
# 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 wri... | 40.719 | 131 | 0.632297 |
d97c22fa1c7fc02beec7148230126903c0db0ac7 | 794 | py | Python | fixture/session.py | tarsic99/Python-training- | 96da2df5f249f39370295504748b218247f2935c | [
"Apache-2.0"
] | null | null | null | fixture/session.py | tarsic99/Python-training- | 96da2df5f249f39370295504748b218247f2935c | [
"Apache-2.0"
] | null | null | null | fixture/session.py | tarsic99/Python-training- | 96da2df5f249f39370295504748b218247f2935c | [
"Apache-2.0"
] | null | null | null | class SessionHelper:
def __init__(self, app):
self.app = app
def login(self, username, password):
wd = self.app.wd
self.app.open_home_page()
wd.find_element_by_name("user").click()
wd.find_element_by_name("user").clear()
wd.find_element_by_name("user").send_keys... | 36.090909 | 78 | 0.642317 |
a5e576e1fe44243e0b1cffc701441313ebf92f04 | 5,856 | py | Python | system_permission/models.py | nianhuatech/bking-permission | 1bee84e24d983274883da9741abcff48d546cc55 | [
"Apache-2.0"
] | 4 | 2021-05-19T02:28:01.000Z | 2021-12-14T04:02:22.000Z | system_permission/models.py | nianhuatech/bking-permission | 1bee84e24d983274883da9741abcff48d546cc55 | [
"Apache-2.0"
] | null | null | null | system_permission/models.py | nianhuatech/bking-permission | 1bee84e24d983274883da9741abcff48d546cc55 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云(BlueKing) available.
Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License.
You may obt... | 37.299363 | 115 | 0.695184 |
937a776f0cc2b610033d58ac0baa1df69744f3eb | 352 | py | Python | SemesterProject/app.py | CJP-12/CMPT-120L-910-20F | ec74b248ed1957ceabd3f96e176e0e244220a9cd | [
"MIT"
] | null | null | null | SemesterProject/app.py | CJP-12/CMPT-120L-910-20F | ec74b248ed1957ceabd3f96e176e0e244220a9cd | [
"MIT"
] | null | null | null | SemesterProject/app.py | CJP-12/CMPT-120L-910-20F | ec74b248ed1957ceabd3f96e176e0e244220a9cd | [
"MIT"
] | null | null | null | from flask import Flask, redirect, url_for
app = Flask(__name__)
@app.route("/")
def home():
return "<h1>Welcome to my project!<h1>"
@app.route("/<name>")
def user(name):
return f"Hello {name}!"
@app.route("/hidden/")
def admin():
return redirect(url_for("user", name= "<h1>Secret Page!<h1>"))
if __name... | 18.526316 | 66 | 0.630682 |
d300952d0f0ee537b239a971e3793ecc8e2dc33f | 1,384 | py | Python | misc/extract_feats_roi.py | Dorothylyly/SAAT | c0113ada53ccb6611089c9b76f342e523b4560bc | [
"MIT"
] | 71 | 2020-03-17T10:09:24.000Z | 2022-03-12T01:11:30.000Z | misc/extract_feats_roi.py | Dorothylyly/SAAT | c0113ada53ccb6611089c9b76f342e523b4560bc | [
"MIT"
] | 37 | 2020-06-18T18:09:16.000Z | 2021-07-30T00:06:35.000Z | misc/extract_feats_roi.py | Dorothylyly/SAAT | c0113ada53ccb6611089c9b76f342e523b4560bc | [
"MIT"
] | 18 | 2020-06-17T09:09:29.000Z | 2021-08-11T09:34:46.000Z | import matplotlib
matplotlib.use('Agg')
from matplotlib import pyplot as plt
from maskrcnn_benchmark.config import cfg
from predictor import COCODemo
import cv2
import os
import h5py
config_file = "../configs/caffe2/e2e_faster_rcnn_R_101_FPN_1x_caffe2.yaml"
# update the config options with the config file
... | 30.086957 | 77 | 0.71026 |
82b927c82f112eab6286d021bb9d07a919a1ee01 | 1,017 | py | Python | others/sub-array-median/median.py | tjeubaoit/algorithm | a1f2a30e0f736cc3d8b45ed845f724b9a4ed2e9a | [
"MIT"
] | null | null | null | others/sub-array-median/median.py | tjeubaoit/algorithm | a1f2a30e0f736cc3d8b45ed845f724b9a4ed2e9a | [
"MIT"
] | null | null | null | others/sub-array-median/median.py | tjeubaoit/algorithm | a1f2a30e0f736cc3d8b45ed845f724b9a4ed2e9a | [
"MIT"
] | null | null | null | import math
def count_median(arr, i, j, n, orders):
size = j + 1 - i
med_pos = math.ceil(size/2)
is_odd = size % 2 != 0
# print(med_pos)
for k in range(0, n):
if orders[k] == med_pos:
break
if is_odd:
return k
else:
k2 = k
while k2 < n:
... | 22.6 | 52 | 0.45821 |
f365a50231511787a4c5eac21350818b3309072f | 6,642 | py | Python | 3algo/results_complilation/timely_sumup.py | allengrr/deadlock_project | 933878077c45a7df04daa087407bb2620c064617 | [
"MIT"
] | null | null | null | 3algo/results_complilation/timely_sumup.py | allengrr/deadlock_project | 933878077c45a7df04daa087407bb2620c064617 | [
"MIT"
] | null | null | null | 3algo/results_complilation/timely_sumup.py | allengrr/deadlock_project | 933878077c45a7df04daa087407bb2620c064617 | [
"MIT"
] | 1 | 2021-03-21T17:54:26.000Z | 2021-03-21T17:54:26.000Z | from data import timely as t
import matplotlib.pyplot as plt
import numpy as np
from textwrap import wrap
fig = plt.figure()
ax1 = fig.add_subplot(411)
ax2 = fig.add_subplot(412)
ax3 = fig.add_subplot(413)
ax4 = fig.add_subplot(414)
width = 0.35
title = {2}
algo_dict = {'RMS + Bankers': r'$ALG_1$',
'EDF ... | 44.878378 | 110 | 0.566546 |
9ab0cf2cce40e17130df315b1ca12a8d754a6d99 | 3,747 | py | Python | qemu-4.2.0/scripts/tracetool/format/log_stap.py | MisaZhu/qemu_raspi | 50d71ce87bb39470e6725f7428e4b6b9e1ed0359 | [
"Apache-2.0"
] | null | null | null | qemu-4.2.0/scripts/tracetool/format/log_stap.py | MisaZhu/qemu_raspi | 50d71ce87bb39470e6725f7428e4b6b9e1ed0359 | [
"Apache-2.0"
] | null | null | null | qemu-4.2.0/scripts/tracetool/format/log_stap.py | MisaZhu/qemu_raspi | 50d71ce87bb39470e6725f7428e4b6b9e1ed0359 | [
"Apache-2.0"
] | 1 | 2020-05-25T09:49:33.000Z | 2020-05-25T09:49:33.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Generate .stp file that printfs log messages (DTrace with SystemTAP only).
"""
__author__ = "Daniel P. Berrange <berrange@redhat.com>"
__copyright__ = "Copyright (C) 2014-2019, Red Hat, Inc."
__license__ = "GPL version 2 or (at your option) any later version"
... | 29.976 | 78 | 0.526021 |
bec6966e7cb02cd8553d87ed49fded3fdc7ab65e | 4,537 | py | Python | tensorflow/python/autograph/utils/testing.py | EricLi404/tensorflow | 23759800d89f7b5362c338d9a3fd72a6810c3e22 | [
"Apache-2.0"
] | 27 | 2019-01-02T09:36:57.000Z | 2022-02-21T06:41:51.000Z | tensorflow/python/autograph/utils/testing.py | EricLi404/tensorflow | 23759800d89f7b5362c338d9a3fd72a6810c3e22 | [
"Apache-2.0"
] | 3 | 2019-01-23T11:01:22.000Z | 2022-02-24T02:53:31.000Z | tensorflow/python/autograph/utils/testing.py | EricLi404/tensorflow | 23759800d89f7b5362c338d9a3fd72a6810c3e22 | [
"Apache-2.0"
] | 11 | 2019-03-02T12:42:23.000Z | 2021-02-04T12:20:10.000Z | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 30.655405 | 80 | 0.689222 |
d6cb2a0c182c362ec2b62830dca406624cffba3d | 78 | py | Python | agent/python/perper/application/__init__.py | aph5nt/perper | ca3d63e0d0dd21b950f4ba038f16fd8e3b1ab566 | [
"MIT"
] | null | null | null | agent/python/perper/application/__init__.py | aph5nt/perper | ca3d63e0d0dd21b950f4ba038f16fd8e3b1ab566 | [
"MIT"
] | null | null | null | agent/python/perper/application/__init__.py | aph5nt/perper | ca3d63e0d0dd21b950f4ba038f16fd8e3b1ab566 | [
"MIT"
] | null | null | null | from .startup import run, run_notebook
from .context import register_delegate
| 26 | 38 | 0.846154 |
ea3d33d995e67df3bd1f6e450123c15bf432870c | 3,685 | py | Python | plugins/BS440mqtt.py | meggiman/BS440 | d9d195c983f1a12fed3d95e91a24638c2eddb04e | [
"MIT"
] | null | null | null | plugins/BS440mqtt.py | meggiman/BS440 | d9d195c983f1a12fed3d95e91a24638c2eddb04e | [
"MIT"
] | null | null | null | plugins/BS440mqtt.py | meggiman/BS440 | d9d195c983f1a12fed3d95e91a24638c2eddb04e | [
"MIT"
] | null | null | null | # coding: utf-8
# -----------------------------------------------------------------------------------------
# BS440 plugin BS440mqtt.py
# About:
# Send collected data via MQTT (e.g. to Home Assistant)
#
# The corresponding configuration for Home Assistant looks like:
# sensor:
# - platform: mqtt
# state_topi... | 34.439252 | 92 | 0.573406 |
f311876acdeb3cd09cf748547850f28442d9d614 | 112,135 | py | Python | lib-python/3/test/test_asyncio/test_tasks.py | hollmmax/zig | d80baa5a5fcbc82b3e2294b398edc20a98737a52 | [
"MIT"
] | null | null | null | lib-python/3/test/test_asyncio/test_tasks.py | hollmmax/zig | d80baa5a5fcbc82b3e2294b398edc20a98737a52 | [
"MIT"
] | null | null | null | lib-python/3/test/test_asyncio/test_tasks.py | hollmmax/zig | d80baa5a5fcbc82b3e2294b398edc20a98737a52 | [
"MIT"
] | null | null | null | """Tests for tasks.py."""
import collections
import contextlib
import contextvars
import functools
import gc
import io
import random
import re
import sys
import types
import textwrap
import traceback
import unittest
import weakref
from unittest import mock
from types import GenericAlias
import asyncio
from asyncio im... | 32.597384 | 105 | 0.587515 |
1542c04d163fe24f914047acb4e4d2eafe8162b8 | 1,897 | py | Python | sc2env/play_four_towers_friendly_unit.py | khlam/sc2env | af0d181dd78b09e6bedda7b0e9c98064adb05641 | [
"MIT"
] | 1 | 2019-01-22T23:36:49.000Z | 2019-01-22T23:36:49.000Z | sc2env/play_four_towers_friendly_unit.py | khlam/sc2env | af0d181dd78b09e6bedda7b0e9c98064adb05641 | [
"MIT"
] | 2 | 2019-07-19T21:28:57.000Z | 2022-03-25T19:14:05.000Z | sc2env/play_four_towers_friendly_unit.py | khlam/sc2env | af0d181dd78b09e6bedda7b0e9c98064adb05641 | [
"MIT"
] | 1 | 2019-06-26T01:21:14.000Z | 2019-06-26T01:21:14.000Z | import logging
import argparse
import os
from importlib import import_module
from abp.configs import NetworkConfig, ReinforceConfig, EvaluationConfig
from abp.examples.pysc2.four_towers_friendly_units.hra import run_task
def main():
parser = argparse.ArgumentParser()
parser.add_argument(
'-f', '--fo... | 26.347222 | 86 | 0.67475 |
cf20991a2a3dcc45aef48d49c68d275e3c69d8a5 | 154,023 | py | Python | src/app.py | hubmapconsortium/entity-api | 09caa5006a1de17a56d3fba21ef76a7480c374be | [
"MIT"
] | 2 | 2021-11-02T20:35:44.000Z | 2021-12-16T14:58:41.000Z | src/app.py | hubmapconsortium/entity-api | 09caa5006a1de17a56d3fba21ef76a7480c374be | [
"MIT"
] | 161 | 2019-11-13T16:47:02.000Z | 2022-03-30T04:05:28.000Z | src/app.py | hubmapconsortium/entity-api | 09caa5006a1de17a56d3fba21ef76a7480c374be | [
"MIT"
] | 1 | 2021-12-03T17:24:45.000Z | 2021-12-03T17:24:45.000Z | import collections
import yaml
from datetime import datetime
from flask import Flask, g, jsonify, abort, request, Response, redirect, make_response
from neo4j.exceptions import TransactionError
import os
import re
import csv
import requests
import urllib.request
from io import StringIO
# Don't confuse urllib (Python na... | 44.463915 | 188 | 0.714127 |
393c2a4ed7fd25d9ba2d903271aeec9f9e1494c9 | 25,117 | py | Python | adafruit_character_lcd/character_lcd.py | jepler/Adafruit_CircuitPython_CharLCD | a9e0c61575e02fe6b5eea348553f1e92d1f55632 | [
"MIT"
] | null | null | null | adafruit_character_lcd/character_lcd.py | jepler/Adafruit_CircuitPython_CharLCD | a9e0c61575e02fe6b5eea348553f1e92d1f55632 | [
"MIT"
] | null | null | null | adafruit_character_lcd/character_lcd.py | jepler/Adafruit_CircuitPython_CharLCD | a9e0c61575e02fe6b5eea348553f1e92d1f55632 | [
"MIT"
] | 1 | 2020-12-07T14:16:40.000Z | 2020-12-07T14:16:40.000Z | # The MIT License (MIT)
#
# Copyright (c) 2017 Brent Rubell for Adafruit Industries
# Copyright (c) 2018 Kattni Rembor for Adafruit Industries
#
# 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 Softwar... | 34.312842 | 99 | 0.617192 |
0d59e1aeb6baa674260e9341886a5b627483b576 | 401 | py | Python | api/database.py | groupwildman/todolist | 7ce990b91e208fdb5ca757e3508a2f0764c16798 | [
"Apache-2.0"
] | null | null | null | api/database.py | groupwildman/todolist | 7ce990b91e208fdb5ca757e3508a2f0764c16798 | [
"Apache-2.0"
] | null | null | null | api/database.py | groupwildman/todolist | 7ce990b91e208fdb5ca757e3508a2f0764c16798 | [
"Apache-2.0"
] | null | null | null | from sqlalchemy import create_engine
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker
SQLALCHEMY_DATABASE_URI = 'sqlite:///todolist.sqlite'
_engine = create_engine(
SQLALCHEMY_DATABASE_URI, connect_args={"check_same_thread": False}
)
_session_local = sessionmaker(aut... | 26.733333 | 78 | 0.810474 |
d5cb786c4586dd9fd365217785fbebf472d1451d | 404 | py | Python | store/migrations/0004_shippingaddress_country.py | ketanv75/Django-training | ca7ad629ce92be370bbbf6e7f8a14cf170fd9174 | [
"bzip2-1.0.6"
] | null | null | null | store/migrations/0004_shippingaddress_country.py | ketanv75/Django-training | ca7ad629ce92be370bbbf6e7f8a14cf170fd9174 | [
"bzip2-1.0.6"
] | null | null | null | store/migrations/0004_shippingaddress_country.py | ketanv75/Django-training | ca7ad629ce92be370bbbf6e7f8a14cf170fd9174 | [
"bzip2-1.0.6"
] | null | null | null | # Generated by Django 3.0.6 on 2021-05-19 19:17
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('store', '0003_auto_20210519_2101'),
]
operations = [
migrations.AddField(
model_name='shippingaddress',
name='countr... | 21.263158 | 62 | 0.608911 |
ec3cbb7462b8d3d54d94695b2935b0283d415d4e | 3,811 | py | Python | resources/libraries/python/MLRsearch/ReceiveRateInterval.py | preym17/csit | 3151c98618c78e3782e48bbe4d9c8f906c126f69 | [
"Apache-2.0"
] | null | null | null | resources/libraries/python/MLRsearch/ReceiveRateInterval.py | preym17/csit | 3151c98618c78e3782e48bbe4d9c8f906c126f69 | [
"Apache-2.0"
] | null | null | null | resources/libraries/python/MLRsearch/ReceiveRateInterval.py | preym17/csit | 3151c98618c78e3782e48bbe4d9c8f906c126f69 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2019 Cisco and/or 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 required by applicable law or ag... | 44.313953 | 80 | 0.683023 |
25b938894b14e87a7a848a5a001a3333f5325d8d | 537 | py | Python | projdir/app/migrations/0031_auto_20160624_1717.py | NITKOSG/InfoGami | f5ce567d5558a768e58886b3419e378cabb7049d | [
"MIT"
] | 2 | 2017-02-01T09:57:40.000Z | 2017-06-03T15:26:55.000Z | projdir/app/migrations/0031_auto_20160624_1717.py | NITKOSG/InfoGami | f5ce567d5558a768e58886b3419e378cabb7049d | [
"MIT"
] | 2 | 2018-05-11T20:10:23.000Z | 2019-05-01T21:13:07.000Z | projdir/app/migrations/0031_auto_20160624_1717.py | NITKOSG/InfoGami | f5ce567d5558a768e58886b3419e378cabb7049d | [
"MIT"
] | 3 | 2017-02-11T13:19:28.000Z | 2018-08-31T18:51:18.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.9.4 on 2016-06-24 11:47
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('app', '0030_messsagemodel_created'),
]
operations = [
migrations.AlterField(... | 25.571429 | 118 | 0.651769 |
c61c45ef810906f6ad15797b1bd2dfdbc935cb92 | 1,595 | py | Python | USACO Prep 2/marathon.py | PythonCoderAS/Algorithims-Assignments | 1f33b6187d5ca36198cee8c7086f07952a1d6cbb | [
"MIT"
] | null | null | null | USACO Prep 2/marathon.py | PythonCoderAS/Algorithims-Assignments | 1f33b6187d5ca36198cee8c7086f07952a1d6cbb | [
"MIT"
] | 1 | 2021-12-31T02:14:55.000Z | 2021-12-31T02:14:55.000Z | USACO Prep 2/marathon.py | PythonCoderAS/Algorithims-Assignments | 1f33b6187d5ca36198cee8c7086f07952a1d6cbb | [
"MIT"
] | null | null | null | def get_distance(coords1, coords2):
"""Gets the distance between 2 pairs of coordinates
Args:
coords1 ([int, int]): The first set of coordinates
coords2 ([int, int]): The second set of coordinates
"""
return abs(coords1[0] - coords2[0]) + abs(coords1[1] - coords2[1])
coordinates = []
... | 36.25 | 92 | 0.697806 |
6fe9cd52136ed350e075521cd78e2588453ce6b9 | 603 | py | Python | buildgrid/_version.py | antmicro/buildgrid | eccb35e3670e52957e189616fbf73dc82e8f83d4 | [
"Apache-2.0"
] | null | null | null | buildgrid/_version.py | antmicro/buildgrid | eccb35e3670e52957e189616fbf73dc82e8f83d4 | [
"Apache-2.0"
] | null | null | null | buildgrid/_version.py | antmicro/buildgrid | eccb35e3670e52957e189616fbf73dc82e8f83d4 | [
"Apache-2.0"
] | null | null | null | # Copyright (C) 2018 Bloomberg LP
#
# 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 writi... | 35.470588 | 74 | 0.754561 |
a04542158e4f8e06c8341e8fc4d8ac71a5730cdb | 1,806 | py | Python | src/streamlink/plugins/nrk.py | sn4kebite/streamlink | 054b760ce7e9f43451eed08e9f39de440c3e5add | [
"BSD-2-Clause"
] | 5 | 2017-03-21T19:43:17.000Z | 2018-10-03T14:04:29.000Z | src/streamlink/plugins/nrk.py | sn4kebite/streamlink | 054b760ce7e9f43451eed08e9f39de440c3e5add | [
"BSD-2-Clause"
] | 7 | 2016-10-13T23:29:31.000Z | 2018-06-28T14:04:32.000Z | src/streamlink/plugins/nrk.py | sn4kebite/streamlink | 054b760ce7e9f43451eed08e9f39de440c3e5add | [
"BSD-2-Clause"
] | 2 | 2016-11-24T18:37:33.000Z | 2017-03-21T19:43:49.000Z | import re
from urllib.parse import urljoin
from streamlink.plugin import Plugin
from streamlink.plugin.api import validate
from streamlink.stream import HLSStream
COOKIE_PARAMS = (
"devicetype=desktop&"
"preferred-player-odm=hlslink&"
"preferred-player-live=hlslink"
)
_id_re = re.compile(r"/(?:program|di... | 27.784615 | 81 | 0.640089 |
7a5cd2d678246bcc019c0c62e193f6ab86fecda4 | 4,445 | py | Python | src/diamond/utils/config.py | harrisonfeng/Diamond | f2bece462577a7c557be8a9f90f6b9340c3db571 | [
"MIT"
] | 2 | 2016-10-24T02:51:32.000Z | 2021-01-09T20:49:44.000Z | src/diamond/utils/config.py | harrisonfeng/Diamond | f2bece462577a7c557be8a9f90f6b9340c3db571 | [
"MIT"
] | 62 | 2016-09-30T14:04:52.000Z | 2021-04-22T21:22:28.000Z | src/diamond/utils/config.py | harrisonfeng/Diamond | f2bece462577a7c557be8a9f90f6b9340c3db571 | [
"MIT"
] | 4 | 2017-01-24T14:44:56.000Z | 2021-03-03T17:14:19.000Z | # coding=utf-8
import configobj
import os
def str_to_bool(value):
"""
Converts string truthy/falsey strings to a bool
Empty strings are false
"""
if isinstance(value, basestring):
value = value.strip().lower()
if value in ['true', 't', 'yes', 'y']:
return True
... | 37.041667 | 79 | 0.499663 |
af73504fdc25539fc41a7e67f4da3bd72f8a5cc1 | 11,645 | py | Python | tools/tf_test_with_log_mgpu.py | luzai/InsightFace_Pytorch | 2f3d865aa5fa14896df27fe9b43a5c4ceb02c7dd | [
"MIT"
] | 4 | 2019-01-24T03:43:36.000Z | 2020-10-24T08:36:28.000Z | tools/tf_test_with_log_mgpu.py | luzai/InsightFace_Pytorch | 2f3d865aa5fa14896df27fe9b43a5c4ceb02c7dd | [
"MIT"
] | null | null | null | tools/tf_test_with_log_mgpu.py | luzai/InsightFace_Pytorch | 2f3d865aa5fa14896df27fe9b43a5c4ceb02c7dd | [
"MIT"
] | null | null | null | import os, sys
from ctypes import *
import numpy as np
import re
import functools
from scipy import spatial
import re
import multiprocessing as mp
import sklearn.preprocessing
try:
import cPickle as pickle
except:
import pickle
import argparse
import tensorflow as tf
import pdb
def generate_test_pair(jk_list... | 37.323718 | 122 | 0.623186 |
f751216398cfa36014558e25485b351239c660c9 | 3,911 | py | Python | witio/splitwise.py | dizzy54/munimji | 2d6616b4924e12d465ec352119a1621c925adc81 | [
"MIT"
] | null | null | null | witio/splitwise.py | dizzy54/munimji | 2d6616b4924e12d465ec352119a1621c925adc81 | [
"MIT"
] | null | null | null | witio/splitwise.py | dizzy54/munimji | 2d6616b4924e12d465ec352119a1621c925adc81 | [
"MIT"
] | null | null | null | from requests_oauthlib import OAuth1Session
from django.conf import settings
client_key = settings.SPLITWISE_CLIENT_KEY
client_secret = settings.SPLITWISE_CLIENT_SECRET
def get_request_token():
""" obtain generic resource owner key and secret from splitwise
"""
request_token_url = 'https://secure.splitw... | 35.554545 | 107 | 0.695474 |
e924fdbbbde54b5197d9da525b7e0da57f4c6840 | 644 | py | Python | experiments/rfcn/rfcn_train_test.py | fourmi1995/IronExperiment-DCN | 5292539764588e0168016c7e7b4df038358e9f38 | [
"MIT"
] | 2 | 2020-11-10T07:37:09.000Z | 2021-02-09T06:26:25.000Z | experiments/rfcn/rfcn_train_test.py | fourmi1995/IronExperiment-DCN | 5292539764588e0168016c7e7b4df038358e9f38 | [
"MIT"
] | null | null | null | experiments/rfcn/rfcn_train_test.py | fourmi1995/IronExperiment-DCN | 5292539764588e0168016c7e7b4df038358e9f38 | [
"MIT"
] | 1 | 2019-08-07T02:35:16.000Z | 2019-08-07T02:35:16.000Z | # --------------------------------------------------------
# Deformable Convolutional Networks
# Copyright (c) 2017 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Yuwen Xiong
# --------------------------------------------------------
import os
import sys
os.environ['PYTHONUN... | 24.769231 | 63 | 0.560559 |
179332543970010e9cab0e87f0de91dbf9f6ebf4 | 242 | py | Python | electrum_gui/common/explorer/data/exceptions.py | Umiiii/electrum | 9e822640680c20c69a69695c033e97605aafcdce | [
"MIT"
] | null | null | null | electrum_gui/common/explorer/data/exceptions.py | Umiiii/electrum | 9e822640680c20c69a69695c033e97605aafcdce | [
"MIT"
] | null | null | null | electrum_gui/common/explorer/data/exceptions.py | Umiiii/electrum | 9e822640680c20c69a69695c033e97605aafcdce | [
"MIT"
] | null | null | null | class ExplorerException(Exception):
pass
class TransactionNotFound(ExplorerException):
def __init__(self, txid: str):
super(TransactionNotFound, self).__init__(f"Transaction {repr(txid)} not found")
self.txid = txid
| 26.888889 | 88 | 0.719008 |
83dacac362385dd24cb9647ad16f70134abd86bb | 28,296 | py | Python | haystack/backends/solr_backend.py | kezabelle/django-haystack | 58ca4cdef58e0158a26275590fc6837fbd55096b | [
"BSD-3-Clause"
] | 1 | 2017-10-12T14:25:06.000Z | 2017-10-12T14:25:06.000Z | filenv/lib/python2.7/site-packages/haystack/backends/solr_backend.py | betoesquivel/fil2014 | 4c2e9188769096391bb206b76ed1ab8bd2ff66a1 | [
"MIT"
] | null | null | null | filenv/lib/python2.7/site-packages/haystack/backends/solr_backend.py | betoesquivel/fil2014 | 4c2e9188769096391bb206b76ed1ab8bd2ff66a1 | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
import warnings
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.db.models.loading import get_model
from django.utils import six
from haystack.backends import BaseEngine, BaseSearchBackend, BaseSearchQuery, log_query, EmptyResul... | 39.136929 | 184 | 0.569763 |
996df28ac810dc93e3bec17dff9fa94b80a2641e | 9,074 | py | Python | tests/integration/test_storage_hdfs/test.py | Rahul171201/ClickHouse | b0600c3751371f0667b15494731f2fbb073605e6 | [
"Apache-2.0"
] | null | null | null | tests/integration/test_storage_hdfs/test.py | Rahul171201/ClickHouse | b0600c3751371f0667b15494731f2fbb073605e6 | [
"Apache-2.0"
] | null | null | null | tests/integration/test_storage_hdfs/test.py | Rahul171201/ClickHouse | b0600c3751371f0667b15494731f2fbb073605e6 | [
"Apache-2.0"
] | null | null | null | import os
import pytest
from helpers.cluster import ClickHouseCluster
from helpers.hdfs_api import HDFSApi
SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__))
cluster = ClickHouseCluster(__file__)
node1 = cluster.add_instance('node1', with_hdfs=True, user_configs=[], main_configs=['configs/log_conf.xml'])
@pyt... | 41.815668 | 145 | 0.65616 |
cc00ca69531811639b039ba179df425915c03894 | 3,199 | py | Python | test/petab/test_amici_objective.py | stephanmg/pyPESTO | 72488fbb3eaa91dd163f88bac71a1a165a0da70f | [
"BSD-3-Clause"
] | null | null | null | test/petab/test_amici_objective.py | stephanmg/pyPESTO | 72488fbb3eaa91dd163f88bac71a1a165a0da70f | [
"BSD-3-Clause"
] | null | null | null | test/petab/test_amici_objective.py | stephanmg/pyPESTO | 72488fbb3eaa91dd163f88bac71a1a165a0da70f | [
"BSD-3-Clause"
] | null | null | null | """
This is for testing the pypesto.Objective.
"""
from pypesto.objective.amici_util import add_sim_grad_to_opt_grad
import petab
import pypesto
import pypesto.petab
import pypesto.optimize
import pypesto.objective.constants
import pytest
import numpy as np
from .petab_util import folder_base
ATOL = 1e-1
RTOL = 1e-0... | 30.466667 | 79 | 0.683651 |
a932a823434a703b05d9e90b790882604e184307 | 1,466 | py | Python | tools/fcos/test_dior_r_quad.py | chisyliu/RotationDetection | 6f2bd55a51a6de0bcd0959a85977682511fd440d | [
"Apache-2.0"
] | 2 | 2022-03-05T09:55:49.000Z | 2022-03-05T10:12:51.000Z | tools/fcos/test_dior_r_quad.py | junhai0428/RotationDetection | 4249720ea4dacdd60e696901df8034e5cd0a1843 | [
"Apache-2.0"
] | null | null | null | tools/fcos/test_dior_r_quad.py | junhai0428/RotationDetection | 4249720ea4dacdd60e696901df8034e5cd0a1843 | [
"Apache-2.0"
] | null | null | null | # -*- coding:utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import sys
sys.path.append("../../")
from alpharotate.libs.models.detectors.fcos import build_whole_network_batch_quad
from tools.test_dior_r_base_q import TestDIORR
from con... | 31.191489 | 91 | 0.629604 |
e51f209728bb72d4a80d0d3ef48d37faa4033b44 | 3,149 | py | Python | 9_GenericCBV/GenericCBV/settings.py | LIkelion-at-KOREATECH/LikeLion_Django_Study_Summary | c788182af5bcfd16bdd4b57235a48659758e494b | [
"MIT"
] | 28 | 2019-10-15T13:15:26.000Z | 2021-11-08T08:23:45.000Z | 9_GenericCBV/GenericCBV/settings.py | jhleed/LikeLion_Django_Study_Summary | c788182af5bcfd16bdd4b57235a48659758e494b | [
"MIT"
] | null | null | null | 9_GenericCBV/GenericCBV/settings.py | jhleed/LikeLion_Django_Study_Summary | c788182af5bcfd16bdd4b57235a48659758e494b | [
"MIT"
] | 17 | 2019-09-09T00:15:36.000Z | 2021-01-28T13:08:51.000Z | """
Django settings for GenericCBV project.
Generated by 'django-admin startproject' using Django 2.1.8.
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 os... | 25.601626 | 91 | 0.694189 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.