commit
stringlengths
40
40
subject
stringlengths
1
1.49k
old_file
stringlengths
4
311
new_file
stringlengths
4
311
new_contents
stringlengths
1
29.8k
old_contents
stringlengths
0
9.9k
lang
stringclasses
3 values
proba
float64
0
1
257134bdaea7c250d5956c4095adf0b917b65aa6
Fix null case for event details
database/dict_converters/event_details_converter.py
database/dict_converters/event_details_converter.py
from database.dict_converters.converter_base import ConverterBase class EventDetailsConverter(ConverterBase): SUBVERSIONS = { # Increment every time a change to the dict is made 3: 0, } @classmethod def convert(cls, event_details, dict_version): CONVERTERS = { 3: cls.even...
from database.dict_converters.converter_base import ConverterBase class EventDetailsConverter(ConverterBase): SUBVERSIONS = { # Increment every time a change to the dict is made 3: 0, } @classmethod def convert(cls, event_details, dict_version): CONVERTERS = { 3: cls.even...
Python
0.000017
1a296a5203c422a7eecc0be71a91994798f01c10
copy name->title for BehaviorAction and BehaviorSequences
tndata_backend/goals/migrations/0020_populate_basebehavior_title_slugs.py
tndata_backend/goals/migrations/0020_populate_basebehavior_title_slugs.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations from django.utils.text import slugify def _copy_name_to_title(model, apps): """Copy the values from the Model's name -> title and name_slug -> title_slug.""" M = apps.get_model("goals", model) for obj in M.ob...
Python
0
94cfc0a7598dd8dcf455311f8bb41c2016c7c3a8
Create solution.py
hackerrank/algorithms/warmup/easy/plus_minus/py/solution.py
hackerrank/algorithms/warmup/easy/plus_minus/py/solution.py
#include <math.h> #include <stdio.h> #include <string.h> #include <stdlib.h> #include <assert.h> #include <limits.h> #include <stdbool.h> int main(void) { int n; scanf("%d",&n); int arr[n]; for(int arr_i = 0; arr_i < n; arr_i++){ scanf("%d",&arr[arr_i]); } const double UNIT_RATIO ...
Python
0.000018
a27d30c4514cef93e054d5597829dc758b04c95e
add xycut in util
TranskribusDU/util/XYcut.py
TranskribusDU/util/XYcut.py
# -*- coding: utf-8 -*- """ XYcut.py vertical/ horizontal cuts for page elements: copyright Naver Labs Europe 2018 READ project """ def mergeSegments(lSegment, iMin): """Take as input a list of interval on some axis, together with the object that contributed to this interval. In...
Python
0.000001
e5e24ddccf5de2fba743a97c1790406259399d18
Create one fixture for all tests
conftest.py
conftest.py
import pytest from fixture.application import Application @pytest.fixture(scope = "session") def app(request): fixture = Application() request.addfinalizer(fixture.destroy) return fixture
Python
0
74d274f02fa23f1a6799e9f96ccb1ef77162f1bc
Add new package: consul (#18044)
var/spack/repos/builtin/packages/consul/package.py
var/spack/repos/builtin/packages/consul/package.py
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class Consul(MakefilePackage): """Consul is a distributed, highly available, and data cen...
Python
0
6427406fc627b467dd4851f32b6a15a74356ef2d
Create new package. (#6043)
var/spack/repos/builtin/packages/r-gviz/package.py
var/spack/repos/builtin/packages/r-gviz/package.py
############################################################################## # Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
Python
0
0a25b4d4c0bc511592d797f6b214dd6fa3f70dd8
FIX unhardwire 'modDate' to easy support for 'creDate'
scripts/managedb/lastest-updates.py
scripts/managedb/lastest-updates.py
#!/usr/bin/python # -*- coding: latin-1 -*- # Copyright 2013 Telefonica Investigacion y Desarrollo, S.A.U # # This file is part of Orion Context Broker. # # Orion Context Broker is free software: you can redistribute it and/or # modify it under the terms of the GNU Affero General Public License as # published by the Fr...
#!/usr/bin/python # -*- coding: latin-1 -*- # Copyright 2013 Telefonica Investigacion y Desarrollo, S.A.U # # This file is part of Orion Context Broker. # # Orion Context Broker is free software: you can redistribute it and/or # modify it under the terms of the GNU Affero General Public License as # published by the Fr...
Python
0
3603669e0359f612b8e68a24b035849e9694aaaf
Add win_system state module
salt/states/win_system.py
salt/states/win_system.py
# -*- coding: utf-8 -*- ''' Management of Windows system information ======================================== This state is used to manage system information such as the computer name and description. .. code-block:: yaml ERIK-WORKSTATION: system: - computer_name This is Erik's computer, don't...
Python
0.000001
0f68667e2ddfee6a370afe5c816a1358cfba799e
Correct GitHub URL.
openfisca_qt/widgets/__init__.py
openfisca_qt/widgets/__init__.py
# -*- coding: utf-8 -*- # OpenFisca -- A versatile microsimulation software # By: OpenFisca Team <contact@openfisca.fr> # # Copyright (C) 2011, 2012, 2013, 2014 OpenFisca Team # https://github.com/openfisca # # This file is part of OpenFisca. # # OpenFisca is free software; you can redistribute it and/or modify # it ...
# -*- coding: utf-8 -*- # OpenFisca -- A versatile microsimulation software # By: OpenFisca Team <contact@openfisca.fr> # # Copyright (C) 2011, 2012, 2013, 2014 OpenFisca Team # https://github.com/openfisca/openfisca # # This file is part of OpenFisca. # # OpenFisca is free software; you can redistribute it and/or mo...
Python
0.000028
b02b3e2e385bc04b2f1b1160371d55f8b6122006
add migration file
pyanalysis/apps/corpus/migrations/0001_initial.py
pyanalysis/apps/corpus/migrations/0001_initial.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import django.utils.timezone class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='Dataset', fields=[ ...
Python
0.000001
980594ab26887a4628620e9e0e00d89ddbdc4e49
Create hackstring.py
hackstring.py
hackstring.py
#! /usr/bin/env python import sys print "".join(["%%%02x" % ord(x) for x in sys.argv[1]]) print "".join(["\\u%04x" % ord(x) for x in sys.argv[1]])
Python
0.000003
739af3ccb50df93b108185ac1e7c0b47cd0bbf31
Add happycopy2.py.
happycopy2.py
happycopy2.py
#!/usr/bin/env python # # Like happycopy.py, but make efforts to fill the buffer when encountering many # small files (e.g. OS X .sparsebundle) # # Picture the scene: converting a drive from HFS+ to NTFS so your TV can play # movies from it directly. # # Problem: copying media files from partition at the end of the d...
Python
0.000001
1dae50ff55de5a2a2b55d7c54465f6e9e35b91ad
Change directories
scripts/CAI_Calculator.py
scripts/CAI_Calculator.py
#!/usr/bin/env python2.7 ''' Created on 18/11/2013 @author: suu13 ''' from collections import Counter from Bio.SeqUtils import CodonUsage from Bio import SeqIO import argparse import re from random import sample from Bio.Data.CodonTable import standard_dna_table from os import remove def codon_count(sequence): ...
Python
0.000001
084dd7fa3836f63d322a5bbf9e0289aa49488abb
Add fastagz field to data objects of process upload-fasta-nucl
resolwe_bio/migrations/0011_nucletide_seq.py
resolwe_bio/migrations/0011_nucletide_seq.py
import gzip import os import shutil from django.conf import settings from django.db import migrations from resolwe.flow.migration_ops import DataDefaultOperation, ResolweProcessAddField, ResolweProcessRenameField from resolwe.flow.utils import iterate_fields FASTA_SCHEMA = { 'name': 'fasta', 'label': 'FASTA ...
Python
0
2df34105a58a05fd1f50f88bc967360b4bd9afc8
Create LongestIncreasingSubseq_001.py
leetcode/300-Longest-Increasing-Subsequence/LongestIncreasingSubseq_001.py
leetcode/300-Longest-Increasing-Subsequence/LongestIncreasingSubseq_001.py
class Solution(object): def lengthOfLIS(self, nums): """ :type nums: List[int] :rtype: int """ n = len(nums) if n == 0: return 0 maxlen = [1 for i in range(n)] for i in range(1, n): for j in range(i): ...
Python
0.000562
d37f57bc2b6816759a6e7108cef4a03322a622ce
Create generator.py
generator.py
generator.py
#!/usr/bin/python3 import random import time import sys import Being # print python version- dev purposes print(sys.version) # generic dice def x_dices_n(x,n): result = 0 for i in range(0, x): roll_dice_n = random.randint(1,n) result = roll_dice_n + result return result # crude race sele...
Python
0.000001
c2d26a5942cb22f4510abd6d5ff8c83d6a386810
make migrations and model updates
masterlist/candidates/migrations/0005_auto_20160725_1759.py
masterlist/candidates/migrations/0005_auto_20160725_1759.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('candidates', '0004_auto_20160708_1422'), ] operations = [ migrations.RemoveField( model_name='candidate', ...
Python
0
94e4d30dbdbcf9765bf731b1bd792d0fcf3f9d4a
Add prettification middleware
maccman/middleware/prettify.py
maccman/middleware/prettify.py
from bs4 import BeautifulSoup class PrettifyMiddleware(object): def process_response(self, request, response): if response.status_code == 200: if response["content-type"].startswith("text/html"): beauty = BeautifulSoup(response.content) response.content = beauty....
Python
0.000001
be530dc2e18ccbeeb3e4396f47d2a527364e6ab1
Add migration for ADS.added_via
migrations/versions/f8c0bde5d368_match_sqlalchemy_defintion_and_actual_.py
migrations/versions/f8c0bde5d368_match_sqlalchemy_defintion_and_actual_.py
"""Match sqlalchemy defintion and actual schema Revision ID: f8c0bde5d368 Revises: ae904ac154cf Create Date: 2019-11-19 11:24:40.555110 """ # revision identifiers, used by Alembic. revision = 'f8c0bde5d368' down_revision = 'ae904ac154cf' from alembic import op import sqlalchemy as sa from sqlalchemy.dialects import...
Python
0.000001
50415300e3ce1e7cc10782aa4661da14d900d6de
Add code generation tests
benchmarks/regression/benchmarks/codegen.py
benchmarks/regression/benchmarks/codegen.py
from examples.seismic.tti.tti_example import tti_setup repeat = 3 class TTI(object): space_order = 12 def setup(self): self.solver = tti_setup(space_order=TTI.space_order) def time_forward(self): self.solver.op_fwd() def time_adjoint(self): self.solver.op_adj()
Python
0
5dd3424e9d95c12c2fb4c770f527b85b928da705
create a separate module for decoration/coloring
decorate.py
decorate.py
class bcolors: HEADER = '\033[95m' OKBLUE = '\033[94m' OKGREEN = '\033[92m' WARNING = '\033[93m' FAIL = '\033[91m' ENDC = '\033[0m' BOLD = '\033[1m' UNDERLINE = '\033[4m'
Python
0
89d08498f7f7e12fa5486eb88f64829621aa27f9
Add missing migration
src/nodeconductor_saltstack/saltstack/migrations/0005_label_change.py
src/nodeconductor_saltstack/saltstack/migrations/0005_label_change.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('saltstack', '0004_remove_spl_state'), ] operations = [ migrations.AlterModelOptions( name='saltstackservice', ...
Python
0.0002
8cde7867eb98cc56533ab0156768ad2409e8c65e
Fix bug
user_notification.py
user_notification.py
#!/usr/bin/python # encoding: utf-8 from datetime import datetime import string from django.core.mail import send_mail from notifications.models import UserNotification import settings email_template = u'''${username}您好: 您有${cnt}条新消息,请点击下面的链接查看: ${msg_url} 感谢使用我们的网站! ${site_name}团队 ''' today = datetime.now() sit...
#!/usr/bin/python # encoding: utf-8 from datetime import datetime import string from django.core.mail import send_mail from notifications.models import UserNotification import settings email_template = u'''${username}您好: 您有${cnt}条新消息,请点击下面的链接查看: ${msg_url} 感谢使用我们的网站! ${site_name}团队 ''' today = datetime.now() sit...
Python
0.000001
6d8fb7d052dc7341ecd9fb3388b804b82f77fa0f
add example usage
examples/scores.py
examples/scores.py
"""Get a list of average scores for each professor in a department.""" import sys from collections import defaultdict import penncoursereview as pcr def prof_scores(dept): professor_scores = defaultdict(list) dept = pcr.Department(dept) for review in dept.reviews.values: instructor = review.instr...
Python
0
7dbc289897ecf35f0b709177ac3feacffd8691ca
add a test file
ch_04/testfile.py
ch_04/testfile.py
#this is a test file for eclipse
Python
0.000001
50194e14a75c3300996f64c415a8593b1243af9f
Add api_helper for testing
src/tests/ggrc/api_helper.py
src/tests/ggrc/api_helper.py
# Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file> # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> # Created By: miha@reciprocitylabs.com # Maintained By: miha@reciprocitylabs.com from ggrc.app import app from ggrc.services.common import Resource from ggrc imp...
Python
0
2b1b1e1d5db7edf4350239b712d2e872e7769d84
add problem 24
euler024.py
euler024.py
#!/usr/bin/env python def nextperm(s): ''' http://en.wikipedia.org/wiki/Permutation#Generation_in_lexicographic_order ''' k = None for i in range(len(s)-1): if s[i] < s[i+1]: k = i if k is None: # sequence in descending order, last permutation return None l = None for i in range(k+1, ...
Python
0.998228
03279bbc6193d3944dcd2542daa65701a1e0eded
Add solution for problem 26
euler026.py
euler026.py
#!/usr/bin/python """ For resolve this, we have to find the maximum Full Reptend Prime int he given limit. To do that, we need to check if the 10 is a primitive root of p. See http://mathworld.wolfram.com/FullReptendPrime.html for details """ from sys import exit for p in range(999, 7, -2): for k in range(1, p)...
Python
0.000159
8373611a9c5b035953aee208bc65f4be92890314
add the conversion script
scripts/conversionScripts/toTransformationNode.py
scripts/conversionScripts/toTransformationNode.py
import xml.etree.ElementTree as ET import xml.dom.minidom as pxml import os def convert(tree,fileName=None): """ Converts input files to be compatible with merge request .... change the attribute of node <variablesTransformation> from 'model' to 'distribution' @ In, tree, xml.etree.ElementTree.ElementTre...
Python
0.000001
55a35c642b64a6bdb8314b9470c1f7fedb16478f
print results
tensorflow/python/keras/utils/np_utils.py
tensorflow/python/keras/utils/np_utils.py
# Copyright 2018 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...
# Copyright 2018 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...
Python
0.000004
ae972cd7fe6856a1265981810ea1d03fc5efcf54
write test for django admin
tests/organisations/test_admin.py
tests/organisations/test_admin.py
import pytest from django.urls import reverse @pytest.mark.django_db def test_organisation_admin_form(client, organisation, admin, user_factory, group_factory): client.login(username=admin, password='password') url = reverse('admin:meinberlin_...
Python
0.000001
cce3b017f36de8fb8682971e13201c0143c524cf
add indexes to make deleting faster
aeromancer/db/alembic/versions/a3d002d161a_add_indexes.py
aeromancer/db/alembic/versions/a3d002d161a_add_indexes.py
"""add indexes Revision ID: a3d002d161a Revises: 22e0aa22ab8e Create Date: 2014-11-24 14:24:29.824147 """ # revision identifiers, used by Alembic. revision = 'a3d002d161a' down_revision = '22e0aa22ab8e' from alembic import op import sqlalchemy as sa def upgrade(): op.create_index('file_project_idx', 'file', [...
Python
0.000001
234c03381209d860d7b6ff29263f927736822c1e
Add shellFlags.py (not yet integrated)
js/shellFlags.py
js/shellFlags.py
import random import os import subprocess def memoize(f, cache={}): '''Function decorator that caches function results.''' # From http://code.activestate.com/recipes/325205-cache-decorator-in-python-24/#c9 def g(*args, **kwargs): key = ( f, tuple(args), frozenset(kwargs.items()) ) if key n...
Python
0
2283ffa381c3e4ff1c5dee639d3cb7c3d09e4bff
format data with portion of cluster center
smoking/integrate_baseline/integrate_with_attr.py
smoking/integrate_baseline/integrate_with_attr.py
import csv from numpy import * def data_import(url): with open(url,'rU') as f_in: reader = csv.reader(f_in) raw_data = list(reader) _x=[] _y=[] _point=list() _point_to_id = dict() index_point = 0 for index,data in enumerate(raw_data): if index==0: contin...
Python
0
61c2823b5da460001ca02db6b028fc770d204e32
Add initial test case
api_tests.py
api_tests.py
from flask import Flask, g import unittest import json from simplekv.fs import FilesystemStore from flaskext.kvsession import KVSessionExtension from api import app, db from common.database import Database class APITest(unittest.TestCase): def setUp(self): global db store = FilesystemStore('sessi...
Python
0.00002
72db299a3974b05f511420da5e5861f3bead0065
Create solution_1.py
problem301/Python/solution_1.py
problem301/Python/solution_1.py
#!/usr/bin/env python # coding=utf-8 def nim(): binary_map = [0,1] total = 3 for k in range(28): binary_map_new = [] for i in range(0, len(binary_map), 2): if binary_map[i:i+2] == [0,0]: binary_map_new.extend([0,0,0,1]) total += 3 elif ...
Python
0.005726
d8a6d199828acae3c54dfcf5529d70c149f0cbd5
add a test (#532)
plenum/test/primary_selection/test_recover_after_demoted.py
plenum/test/primary_selection/test_recover_after_demoted.py
from plenum.common.constants import ALIAS, SERVICES from plenum.test.helper import sdk_send_random_and_check, waitForViewChange from plenum.test.node_catchup.helper import ensure_all_nodes_have_same_data from plenum.test.pool_transactions.helper import updateNodeData, \ buildPoolClientAndWallet from plenum.test.vi...
Python
0
53bf5c12b77e19d54e3ab50ade8840843cca9649
add sql group_by unit tests
siuba/tests/test_verb_group_by.py
siuba/tests/test_verb_group_by.py
""" Note: this test file was heavily influenced by its dbplyr counterpart. https://github.com/tidyverse/dbplyr/blob/master/tests/testthat/test-verb-group_by.R """ from siuba import _, group_by, ungroup, summarize from siuba.dply.vector import row_number, n import pytest from .helpers import assert_equal_query, d...
Python
0.000001
c0d0496eb2675ba2dbd5dbaa9d4b4c701409308f
Allow IHaskellPrelude.hs to not be formatting checked
verify_formatting.py
verify_formatting.py
#!/usr/bin/env python3 from __future__ import print_function import sys import os import subprocess def hindent(contents): with open(".tmp3", "w") as f: f.write(contents) with open(".tmp3", "r") as f: output = subprocess.check_output(["hindent", "--style", "gibiansky"], ...
#!/usr/bin/env python3 from __future__ import print_function import sys import os import subprocess def hindent(contents): with open(".tmp3", "w") as f: f.write(contents) with open(".tmp3", "r") as f: output = subprocess.check_output(["hindent", "--style", "gibiansky"], ...
Python
0
930a8b1a7c980183df5469627a734033ca39a444
Add functional tests for create_image
shade/tests/functional/test_image.py
shade/tests/functional/test_image.py
# -*- coding: utf-8 -*- # 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, softw...
Python
0.000012
59ef02377c41041fd8010231f2c86d1aba072c0f
Complete recur sol
lc0105_construct_binary_tree_from_preorder_and_inorder_traversal.py
lc0105_construct_binary_tree_from_preorder_and_inorder_traversal.py
"""Leetcode 105. Construct Binary Tree from Preorder and Inorder Traversal Medium URL: https://leetcode.com/problems/construct-binary-tree-from-preorder-and-inorder-traversal/ Given preorder and inorder traversal of a tree, construct the binary tree. Note: You may assume that duplicates do not exist in the tree. Fo...
Python
0.000007
9c045f7667e1bdc6c9137c3877292907f4623774
Add a management command to check if URNs are present in the database
make_a_plea/management/commands/check_urns_in_db.py
make_a_plea/management/commands/check_urns_in_db.py
import csv from django.core.management.base import BaseCommand from apps.plea.models import DataValidation, Case from apps.plea.standardisers import standardise_urn, format_for_region class Command(BaseCommand): help = "Build weekly aggregate stats" def add_arguments(self, parser): parser.add_argum...
Python
0
4759cf1b058d1a1b5999882a8b44f84ad89a8a9a
Add tests file
arangodb/tests.py
arangodb/tests.py
# -*- coding: utf-8 -*-
Python
0.000001
64b572a4e1e8359d781591e22439fb432c5860b6
Create click_location.py
click_location.py
click_location.py
from PIL import Image from pylab import * im = array(Image.open('img.jpg')) show() while(1): imshow(im) print "Please click 3 points" x = ginput(1) print 'you clicked:',x
Python
0.000001
607a73317e0497ee206bf8381f7cfa9fe46a1609
add xml-row-to-vector script
src/4_train_models/vectorize_data.py
src/4_train_models/vectorize_data.py
#!/usr/bin/python3 from bs4 import BeautifulSoup from tqdm import tqdm import numpy as np import pickle #http://stackoverflow.com/a/27518377/2230446 def get_num_lines(filename): f = open(filename, "rb") num_lines = 0 buf_size = 1024 * 1024 read_f = f.raw.read buf = read_f(buf_size) while buf: ...
Python
0.000002
d6e9971ceefc69f0eefc7440cc5e7035e7dcc05d
Add the middleware for reporting errors to gcloud.
contentcuration/contentcuration/middleware/ErrorReportingMiddleware.py
contentcuration/contentcuration/middleware/ErrorReportingMiddleware.py
from google.cloud import error_reporting class ErrorReportingMiddleware(object): def __init__(self, *args, **kwargs): self.client = error_reporting.Client() def process_exception(self, request, exception): self.client.report_exception()
Python
0
e3ab7c126f808864f0458b52f36518e485f546ca
Add a session class to help tie everything together in a convenient way.
source/harmony/session.py
source/harmony/session.py
# :coding: utf-8 # :copyright: Copyright (c) 2013 Martin Pengelly-Phillips # :license: See LICENSE.txt. import os from harmony.schema.collection import Collection from harmony.schema.collector import FilesystemCollector from harmony.schema.processor import MixinProcessor, ValidateProcessor from harmony.schema.validat...
Python
0
c240f7bcd94b2fe6ead8568f6f6f5a69c1853b3a
Add a shelve/unshelve scenario
tempest/scenario/test_shelve_instance.py
tempest/scenario/test_shelve_instance.py
# Copyright 2014 Scality # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
Python
0.000001
c2036cd7629b93bfc12069eaf174f2427d47e769
add another test
tests/monitoring/test_check_mesos_duplicate_frameworks.py
tests/monitoring/test_check_mesos_duplicate_frameworks.py
# Copyright 2015-2016 Yelp 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 writin...
Python
0.000004
0b81997dd12f775fc9f814c19fb62ef35bde998e
Add ceres library
autoconf/ceres.py
autoconf/ceres.py
from _external import * from pthread import * from amd import * from gomp import * from lapack import * from suitesparse import * from glog import * ceres = LibWithHeaderChecker('ceres', 'ceres/ceres.h', 'c++', name='ceres', dependencies = [gomp,lapack,suitesparse,amd,pthread,glog],)
Python
0.000001
681f73490fd7d333883134a417477492744ce22a
Add project permissions
src/python/expedient/clearinghouse/project/permissions.py
src/python/expedient/clearinghouse/project/permissions.py
''' Created on Aug 3, 2010 @author: jnaous ''' from expedient.common.permissions.shortcuts import create_permission from expedient.clearinghouse.permissionmgmt.utils import \ request_permission_wrapper create_permission( "can_create_project", description=\ "Owners of this permission can create pro...
Python
0.000001
293b3a0e463a5a215b49c59d03a0cf280428c6c4
Add bootstrap script for buildout
bootstrap.py
bootstrap.py
############################################################################## # # Copyright (c) 2006 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOF...
Python
0.000001
bd9fce88c235ea6be032a1d15a31bf41df14a444
Fix missing migration
djangocms_blog/migrations/0033_auto_20180226_1410.py
djangocms_blog/migrations/0033_auto_20180226_1410.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('djangocms_blog', '0032_auto_20180109_0023'), ] operations = [ migrations.AlterField( model_name='blogcategorytra...
Python
0.999773
c0e03b41fbd95fd5c556205d96fd5bd935b55b0e
make wav and noisy slices
make_tfrecords.py
make_tfrecords.py
from __future__ import print_function import tensorflow as tf import numpy as np from collections import namedtuple, OrderedDict from subprocess import call import cPickle as pickle import scipy.io.wavfile as wavfile import gzip import h5py import argparse import codecs import timeit import struct import toml import re...
Python
0.000001
07ef4a6440b59ed6ce207d3442f7ba950a8f9ec8
Python script to compute cost.
compute_cost.py
compute_cost.py
"""compute_cost.py: """ __author__ = "Dilawar Singh" __copyright__ = "Copyright 2016, Dilawar Singh" __credits__ = ["NCBS Bangalore"] __license__ = "GNU GPL" __version__ = "1.0.0" __maintainer__ = "Dilawar Singh" __email__ = "dilawars@ncbs.res.in" __st...
Python
0.999849
7a0bbdb2395ca1e8579e0f2cc6ccd43807c51161
Create 6kyu_alpha_to_numeric_and_numeric_to_alpha.py
Solutions/6kyu/6kyu_alpha_to_numeric_and_numeric_to_alpha.py
Solutions/6kyu/6kyu_alpha_to_numeric_and_numeric_to_alpha.py
import re def AlphaNum_NumAlpha(string): return ''.join(swap(s) for s in re.findall('\d{1,2}|[a-z]', string)) def swap(s): return chr(int(s)+96) if s.isdigit() else str(ord(s)-96)
Python
0.999268
20c51dbcd2d90bfa234efa5027254a4915995edd
add nmap_hosts migration
alembic/versions/13b7c3d4c802_create_nmap_hosts_table.py
alembic/versions/13b7c3d4c802_create_nmap_hosts_table.py
"""create nmap_hosts table Revision ID: 13b7c3d4c802 Revises: ecd5f49567a6 Create Date: 2017-07-21 08:19:17.849112 """ from sqlalchemy.dialects import postgresql from alembic import op import sqlalchemy as sa import datetime def _get_date(): return datetime.datetime.now() # revision identifiers, used by Alembi...
Python
0
941985a561d0bdce1a8aba2e57fc60f90b6164fb
Add jrun main module so "python jrun" works
jrun/__main__.py
jrun/__main__.py
import jrun if __name__ == '__main__': jrun.jrun_main()
Python
0.000036
b27b3089f393a84c3d004e8d89be43165862be1d
add match matrix
matrix_match.py
matrix_match.py
import random w1 = int(raw_input(">>> w1: ")) h1 = int(raw_input(">>> h1: ")) w2 = int(raw_input(">>> w2: ")) h2 = int(raw_input(">>> h2: ")) r1 = int(raw_input(">>> r1: ")) r2 = int(raw_input(">>> r2: ")) # w1 = 20 # h1 = 20 # w2 = 3 # h2 = 3 matrix = [[random.randint(r1, r2) for x in range(w1)] for x in range(h1)...
Python
0.000002
40f92e6293bb13ee1462b932be15f5f11ceeee74
Add initial implementation of TempType.
compiler/infer.py
compiler/infer.py
""" # ---------------------------------------------------------------------- # infer.py # # Type inference for Llama # http://courses.softlab.ntua.gr/compilers/2012a/llama2012.pdf # # Authors: Nick Korasidis <renelvon@gmail.com> # Dimitris Koutsoukos <dim.kou.shmmy@gmail.com> # --------------------------------...
Python
0
a2e27feff324d5aed7220a520df651f688cd1829
Add migration
bluebottle/assignments/migrations/0002_auto_20190529_1755.py
bluebottle/assignments/migrations/0002_auto_20190529_1755.py
# -*- coding: utf-8 -*- # Generated by Django 1.11.15 on 2019-05-29 15:45 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('assignments', '0001_initial'), ] operations = [ migrations.RenameField( ...
Python
0.000002
9ca926d052edc754ca3b6f3663b1c00887b2965a
add migration with blank projects.Tag
brasilcomvc/projects/migrations/0004_tag_may_be_blank.py
brasilcomvc/projects/migrations/0004_tag_may_be_blank.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('projects', '0003_project_tags'), ] operations = [ migrations.AlterField( model_name='project', name=...
Python
0.000001
77ce1e2606132a5a04bc8c1b86c14f6f590e458d
test script added for assessment_lookups
doc/dlkit-gstudio-impl/assessment_lookup.py
doc/dlkit-gstudio-impl/assessment_lookup.py
from dlkit_runtime import PROXY_SESSION, RUNTIME from dlkit_gstudio.gstudio_user_proxy import GStudioRequest req_obj = GStudioRequest(id=1) condition = PROXY_SESSION.get_proxy_condition() condition.set_http_request(req_obj) proxy = PROXY_SESSION.get_proxy(condition) assessment_service_mgr = RUNTIME.get_service_manager(...
Python
0
a6d3ae8b27f6e97e7e5b4388a20836f25953c26d
Add example config file
config-example.py
config-example.py
""" Minimal config file for kahvibot. Just define values as normal Python code. """ # put your bot token here as a string bot_token = "" # the tg username of the bot's admin. admin_username = "" # if a message contains any of these words, the bot responds trigger_words = [ "kahvi", "\u2615", # coffee emoji ...
Python
0.000001
bcda14f8258daaf3475dd9d3ca3eb7b25aa0496c
Add py-voluptuous (#13457)
var/spack/repos/builtin/packages/py-voluptuous/package.py
var/spack/repos/builtin/packages/py-voluptuous/package.py
# Copyright 2013-2019 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class PyVoluptuous(PythonPackage): """Voluptous, despite the name, is a Python data validation l...
Python
0
93000ab88c489f720d0f7e6a8921dc69342d61f1
Add migration
webapp/apps/dynamic/migrations/0012_auto_20160616_1908.py
webapp/apps/dynamic/migrations/0012_auto_20160616_1908.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('dynamic', '0011_auto_20160614_1902'), ] operations = [ migrations.RenameField( model_name='dynamicbehaviorsavein...
Python
0.000002
662ad845a0ce729d8d8b72121a4c7c6f22e3eaa2
support for phonetic similarity added
src/indicnlp/script/phonetic_sim.py
src/indicnlp/script/phonetic_sim.py
# Copyright Anoop Kunchukuttan 2014 - present # # This file is part of Indic NLP Library. # # Indic NLP Library is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your o...
Python
0
30ea7b5c77acc0af8826e3aef6155f9d329ed419
Create getCpuUsage2.py
mesosmetrics/getCpuUsage2.py
mesosmetrics/getCpuUsage2.py
import urllib import json import time import sys if __name__ == '__main__': agent=sys.argv[1] url = "http://" + agent + ":5051/monitor/statistics" executors = {} response = urllib.urlopen(url) data = json.loads(response.read()) for itm in data: executor = {} id = itm["executor_id"] executor["name"...
Python
0
93a41a7d406e5f7c264865d96c0f85b1181e5cb0
add basic test
tests/utils_tests/extension_tests/test_forward.py
tests/utils_tests/extension_tests/test_forward.py
import mock import numpy as np import unittest import chainer from chainer import testing from chainercv.utils import forward @testing.parameterize(*testing.product({ 'in_shapes': [((3, 4),), ((3, 4), (5,))], 'out_shapes': [((3, 4),), ((3, 4), (5,))], 'variable': [True, False], })) class TestForward(uni...
Python
0.000022
4802b8fe149ed72303bbb0f1f924275dbc004b5a
Use the handy interruptible pool from emcee
Examples/interruptible_pool.py
Examples/interruptible_pool.py
# -*- coding: utf-8 -*- """ The MIT License (MIT) Copyright (c) 2010-2013 Daniel Foreman-Mackey & contributors. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including wit...
Python
0
4cc1c75356ac97632345c1900d45ac74521079cd
Find an average
ch03_03_p.py
ch03_03_p.py
summation = 0 input_number = float(input()) number_of_input = 0 while input_number != -1: number_of_input += 1 summation += input_number input_number = float(input()) if 0 == number_of_input: print("No Data") else: print(summation / number_of_input)
Python
0.999994
133da92ed69aafc6c0a8d4466cf3b0266c5edc68
Add migration for change in profile model.
userprofile/migrations/0006_auto_20180309_2215.py
userprofile/migrations/0006_auto_20180309_2215.py
# -*- coding: utf-8 -*- # Generated by Django 1.11 on 2018-03-09 22:15 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('userprofile', '0005_auto_20171121_1923'), ] operations = [ migrations.AlterFi...
Python
0
4bce7685c39e7efbb674407184d0bf436cbdaec0
Create ftxproxy.py
ftxproxy.py
ftxproxy.py
#!/usr/bin/python # This is a simple port-forward / proxy, written using only the default python # library. If you want to make a suggestion or fix something you can contact-me # at voorloop_at_gmail.com # Distributed over IDC(I Don't Care) license import socket import select import time import sys # Changing the buff...
Python
0
350f7056e895dd8ddee756779ae50522f099f998
Add tests for the oauth2 decorators
yithlibraryserver/oauth2/tests/test_decorators.py
yithlibraryserver/oauth2/tests/test_decorators.py
# Yith Library Server is a password storage server. # Copyright (C) 2014 Lorenzo Gil Sanchez <lorenzo.gil.sanchez@gmail.com> # # This file is part of Yith Library Server. # # Yith Library Server is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as publ...
Python
0
f93ae9f59dcbb834b93fa3a57d89d84c4520baa0
Create collector.py
collector.py
collector.py
import os from subprocess import Popen, PIPE import tarfile import json import shutil import re def move(file, origin, destination): if not file: return if not isinstance(file, basestring): for entry in file: move(entry, origin, destination) return destination_path =...
Python
0.000001
ec8f6fdba200fcb4816e170c1517899f1c03db04
added vowels
vowels.py
vowels.py
# Copyright © 2014 Bart Massey # Print the hex value of the set of vowels. n = 0 for c in ('a', 'e', 'i', 'o', 'u'): b = 2**(ord(c) - ord('a')) n += b print(format(n, "x"))
Python
0.999665
0f1475eddf3f9237a1f746784b090a4f65d96226
add import script for Swindon
polling_stations/apps/data_collection/management/commands/import_swindon.py
polling_stations/apps/data_collection/management/commands/import_swindon.py
from data_collection.management.commands import BaseXpressDemocracyClubCsvImporter class Command(BaseXpressDemocracyClubCsvImporter): council_id = 'E06000030' addresses_name = 'parl.2017-06-08/Version 1/Democracy_Club__08June2017 (11).tsv' stations_name = 'parl.2017-06-08/Version 1/Democracy_Club__08June20...
Python
0
9366fe261b2f13f81678851fd5ae4a0035a811c7
Add new package: py-walinuxagent (#18961)
var/spack/repos/builtin/packages/py-walinuxagent/package.py
var/spack/repos/builtin/packages/py-walinuxagent/package.py
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class PyWalinuxagent(PythonPackage): """Microsoft Azure Linux Guest Agent.""" homepage = "h...
Python
0
ce647d22a2a65ea40d259b064a6b4f611ca669af
Add test codes for wheels
wheels.py
wheels.py
#!/usr/bin/python2 #coding=utf-8 import RPi.GPIO as GPIO import time ''' 2 L298N control 4 Motors. SOC Control GPIO Front Motor: (Left) 15-ENDA, 31-forward,33-backward (Right)29-ENDB, 35-forward,37-backward Rear Motor: (Left) 18-ENDB, 38-forward,40-backward (Right)25-ENDA, 36-forward,32-b...
Python
0
f3db6608c2b4afeb214c3f1b94e0175609ad0b88
Add migration file for event slug changes
cs4teachers/events/migrations/0018_auto_20170706_0803.py
cs4teachers/events/migrations/0018_auto_20170706_0803.py
# -*- coding: utf-8 -*- # Generated by Django 1.11.2 on 2017-07-06 08:03 from __future__ import unicode_literals import autoslug.fields from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('events', '0017_auto_20170705_0952'), ] operations = [ migrat...
Python
0
7d10648275e991fda42c6dccbce340d37d442115
fix test on test_cell
src/test/test_cell.py
src/test/test_cell.py
import unittest, os import numpy as np from particles import PointDipoleList from molecules import Cluster, Atom from use_generator import Generator import dstruct FILE_XYZ = os.path.join( os.path.dirname(__file__), 'pna_waters.xyz' ) FILE_MOL = os.path.join( os.path.dirname(__file__), 'tip3p44_10qm.mol' ) FILE_PDB = ...
Python
0.000002
d03254dabaac466edd697de38c3433475828bd4f
Add tests for has_changes
tests/functions/test_has_changes.py
tests/functions/test_has_changes.py
import sqlalchemy as sa from sqlalchemy.ext.declarative import declarative_base from sqlalchemy_utils import has_changes class TestHasChanges(object): def setup_method(self, method): Base = declarative_base() class Article(Base): __tablename__ = 'article_translation' id =...
Python
0.000001
795cd6e190a1cc4d416c5524399780e586dc6c45
Add better kitt script
kitt/kitt.py
kitt/kitt.py
from microbit import * display.scroll("I am the Knight Industries 2000") MAX_ROWS = 4 MAX_BRIGHTNESS = 9 MIN_BRIGHTNESS = 2 def scan(reverse=False): for i in range(0, 9): brightness = MAX_BRIGHTNESS row_range = range(0, i+1) if not reverse else range(i, -1, -1) counter = 0 for ...
Python
0
a6ac5055a1867259ab17997a076299731e57c45b
Add Android extractor
strings2pot/extractors/android.py
strings2pot/extractors/android.py
# -*- coding: utf-8 -*- import re import xml.etree.ElementTree as ET class AndroidExtractor: def __init__(self, source_file, destination_file, context_id_generator): self.source_file = source_file self.destination_file = destination_file self._create_context_id = context_id_generator ...
Python
0.000001
c711f62ef96d67a6e42e3bbe10c0b3cd64a23444
add moviepy - text_hineinzoomen
moviepy/text_hineinzoomen.py
moviepy/text_hineinzoomen.py
#!/usr/bin/env python # Video mit Text erzeugen, hineinzoomen (Text wird grösser) # Einstellungen text = 'Text' # Text textgroesse = 150 # Textgroesse in Pixel textfarbe_r = 0 # Textfarbe R textfarbe_g = 0 # Textfarbe G textfarbe_b = 0 # Textfarbe B schrift ...
Python
0.000001
c61b1595709b6acd26cf7c43e7858e3ad5cb588f
Add missing module.
csvkit/headers.py
csvkit/headers.py
#!/usr/bin/env python def make_default_headers(n): """ Make a set of simple, default headers for files that are missing them. """ return [u'column%i' % (i + 1) for i in range(n)]
Python
0
1ad62b8fcffd88cc5aecb01418650e09aaa7ffad
Add deck_test.py, it's only a script for test when programming.
deck_test.py
deck_test.py
import os import json from hearthstone.deckstrings import Deck from hearthstone.enums import FormatType from hearthstone.cardxml import load from hearthstone.enums import Locale,Rarity from collection import Collection # Create a deck from a deckstring deck = Deck() deck.heroes = [7] # Garrosh Hellscream deck.format ...
Python
0
9b50da16238d2f816199c8fb8a20ec558edf5d46
Create oie_compress.py
oie_compress.py
oie_compress.py
# 1.0 much be paid on insurance claim # 1.0 much is paid # 1.0 much is paid on insurance claim # 1.0 much be paid # ----------------------------------------------------- # 1.0 channel joining two bodies # 1.0 channel joining two larger bodies of water # 1.0 channel joining two larger bodies # 1.0 channel joining two bo...
Python
0.000002
aad116d8bd35eee22d07edaff4cd8ddf80ea80be
Create 2.3Identify_SeasonalValues.py
UseCases_files/3Figures_Python/2.3Identify_SeasonalValues.py
UseCases_files/3Figures_Python/2.3Identify_SeasonalValues.py
# Use Case 2.3Identify_SeasonalValues # plot Seasonal data for multiple scenarios # Adel Abdallah # October 30, 2017 import plotly import plotly.plotly as py import plotly.graph_objs as go from random import randint import pandas as pd ## read the input data from GitHub csv file which is a direct query output # 3....
Python
0.000005
302f98844487d894252d3dc3f4d30940fbcbd9e1
Allow pex to be invoked using runpy (python -m pex). (#637)
pex/__main__.py
pex/__main__.py
# Copyright 2019 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import absolute_import from pex.bin import pex __name__ == '__main__' and pex.main()
Python
0.000065
51398136622566b36a077e80841d10957d0108c3
add liveview sample code
playLiveview.py
playLiveview.py
#!/usr/bin/env python from sonyAPI2 import API2 import cv2 import urllib2 import numpy as np import time import struct api = API2() # api.update_url() api.update_api_list() try: result = api.do('startLiveview') url = result['result'][0] except KeyError: print result f = urllib2.ur...
Python
0
8f506c20ccad47ee6f2454a419145b1b2b48adba
Create bold-words-in-string.py
Python/bold-words-in-string.py
Python/bold-words-in-string.py
# Time: O(n * l), n is the length of S, l is the average length of words # Space: O(t), t is the size of trie class Solution(object): def boldWords(self, words, S): """ :type words: List[str] :type S: str :rtype: str """ _trie = lambda: collections.defaultdict(_...
Python
0.999987
ea0c49745ef454779e711acd3a2f6bc40ce9cf74
add multichannel
multichannel-imdb.py
multichannel-imdb.py
import logging from keras.layers.recurrent import LSTM, GRU from keras.models import Sequential, model_from_json, Graph from keras.layers.core import Dense, Dropout, MaxoutDense, Activation from keras.layers.advanced_activations import PReLU from keras.callbacks import EarlyStopping, ModelCheckpoint, Callback from kera...
Python
0.998781
2623e5e18907c1ca13661e1f468368fb17bc50d9
add preproc tests
py/desispec/test/test_preproc.py
py/desispec/test/test_preproc.py
import unittest import numpy as np from desispec.preproc import preproc, _parse_sec_keyword class TestPreProc(unittest.TestCase): def setUp(self): hdr = dict() hdr['CAMERA'] = 'b0' hdr['DATE-OBS'] = '2018-09-23T08:17:03.988' hdr['CCDSEC'] = '[1:200,1:150]' hdr['BIASSEC...
Python
0
228f4325aa5f1c8b616f45462280b4a7cb0792dd
Add test for empty files to csvjoin
tests/test_utilities/test_csvjoin.py
tests/test_utilities/test_csvjoin.py
#!/usr/bin/env python import sys try: from mock import patch except ImportError: from unittest.mock import patch from csvkit.utilities.csvjoin import CSVJoin, launch_new_instance from tests.utils import CSVKitTestCase, EmptyFileTests class TestCSVJoin(CSVKitTestCase, EmptyFileTests): Utility = CSVJoin ...
#!/usr/bin/env python import sys try: from mock import patch except ImportError: from unittest.mock import patch from csvkit.utilities.csvjoin import CSVJoin, launch_new_instance from tests.utils import CSVKitTestCase class TestCSVJoin(CSVKitTestCase): Utility = CSVJoin def test_launch_new_instanc...
Python
0
dbb127a6fbadfa17f5faad45e8d7ebb6b943a77d
add basic test for vamp_spectral_centroid
tests/test_vamp_spectral_centroid.py
tests/test_vamp_spectral_centroid.py
#! /usr/bin/env python import unittest from unit_timeside import TestRunner from timeside.plugins.decoder.aubio import AubioDecoder as FileDecoder from timeside.core import get_processor from timeside.core.tools.test_samples import samples class TestVampSpectralCentroid(unittest.TestCase): proc_id = 'vamp_spect...
Python
0.000001
86c67f321ec4ee7c254fde4a7f942a83d5e35016
Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/00734af980b920f9f963badf85fbeb12d576fde5.
third_party/tf_runtime/workspace.bzl
third_party/tf_runtime/workspace.bzl
"""Provides the repository macro to import TFRT.""" load("//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls") def repo(): """Imports TFRT.""" # Attention: tools parse and update these lines. TFRT_COMMIT = "00734af980b920f9f963badf85fbeb12d576fde5" TFRT_SHA256 = "0c136cdfb87ae3663c162ad807c5...
"""Provides the repository macro to import TFRT.""" load("//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls") def repo(): """Imports TFRT.""" # Attention: tools parse and update these lines. TFRT_COMMIT = "d1caeb8bdba1851194baf06c28ea09b5b67e5623" TFRT_SHA256 = "e480ad7451b9e3ce45da61d71079...
Python
0
8cf5b328d7596a9b74490b7dfd4a1b8aa1577b55
Merge remote-tracking branch 'origin' into AC-9512
accelerator/migrations/0110_remove_bucket_list_program_role_20220707_1001.py
accelerator/migrations/0110_remove_bucket_list_program_role_20220707_1001.py
from django.db import migrations def remove_bucket_list_program_roles(apps, schema_editor): BucketState = apps.get_model('accelerator', 'BucketState') ProgramRole = apps.get_model('accelerator', 'ProgramRole') ProgramRoleGrant = apps.get_model('accelerator', 'ProgramRoleGrant') NodePublishedFor = apps...
Python
0
5945fe5c527b3f5cb2ed104eccdf9266dc702eb1
add second order constraint
toppra/constraint/can_linear_second_order.py
toppra/constraint/can_linear_second_order.py
from .canonical_linear import CanonicalLinearConstraint from .constraint import DiscretizationType import numpy as np class CanonicalLinearSecondOrderConstraint(CanonicalLinearConstraint): """ A class to represent Canonical Linear Generalized Second-order constraints. Parameters ---------- inv_dyn: (...
Python
0.009653